1
0
forked from noxious/client

Only update value if is self

This commit is contained in:
Dennis Postma 2025-02-16 18:21:53 +01:00
parent 9a8220e4e0
commit dbb4cae154

View File

@ -44,6 +44,7 @@ export function useGameControlsComposable(scene: Phaser.Scene, layer: Phaser.Til
gameStore.connection?.emit(SocketEvent.MAP_CHARACTER_MOVE, [x, y]) gameStore.connection?.emit(SocketEvent.MAP_CHARACTER_MOVE, [x, y])
gameStore.connection?.on(SocketEvent.MAP_CHARACTER_MOVE, ([characterId, posX, posY, rot, isMoving]: [string, number, number, number, boolean]) => { gameStore.connection?.on(SocketEvent.MAP_CHARACTER_MOVE, ([characterId, posX, posY, rot, isMoving]: [string, number, number, number, boolean]) => {
if (characterId !== gameStore.character?.id) return
currentPosition = { x: posX, y: posY } currentPosition = { x: posX, y: posY }
}) })