forked from noxious/server
Stop moving if path is invalid
This commit is contained in:
parent
17fa2a8f6e
commit
9f84247839
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user