1
0
forked from noxious/client

Teleport walk fix

This commit is contained in:
Dennis Postma 2025-02-16 18:16:35 +01:00
parent bc0db8b32b
commit 9a8220e4e0

View File

@ -43,6 +43,9 @@ export function useGameControlsComposable(scene: Phaser.Scene, layer: Phaser.Til
if (x === currentPosition.x && y === currentPosition.y) return
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]) => {
currentPosition = { x: posX, y: posY }
})
currentPosition = { x, y }
}