forked from noxious/client
Only update value if is self
This commit is contained in:
parent
9a8220e4e0
commit
dbb4cae154
@ -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 }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user