diff --git a/src/events/map/characterMove.ts b/src/events/map/characterMove.ts index 961b061..6703a86 100644 --- a/src/events/map/characterMove.ts +++ b/src/events/map/characterMove.ts @@ -57,12 +57,16 @@ export default class CharacterMove extends BaseEvent { const path = await CharacterMoveService.calculatePath(character, Math.floor(positionX), Math.floor(positionY)) if (!path?.length) { + // Ensure movement state is cleaned up for invalid paths + mapCharacter.isMoving = false + mapCharacter.currentPath = null + CharacterMoveService.broadcastMovement(character, false) return } - // Set new movement state - mapCharacter.isMoving = true + // Only set movement state if we have a valid path mapCharacter.currentPath = path + mapCharacter.isMoving = true this.isProcessingMove = true // Start the movement