1
0
forked from noxious/server

Re added the movement interruption code to allow overwriting movement

Still needs tinkering
This commit is contained in:
Colin Kallemein 2025-01-02 23:47:55 +01:00
parent ce80eb223c
commit 9a016a1fb6

View File

@ -21,9 +21,10 @@ export default class CharacterMove extends BaseEvent {
return
}
// If already moving, ignore new movement request
// If already moving, cancel current movement and wait for it to fully stop
if (zoneCharacter.isMoving) {
return
zoneCharacter.isMoving = false
await new Promise((resolve) => setTimeout(resolve, 50))
}
const path = await this.characterService.calculatePath(zoneCharacter.character, positionX, positionY)