1
0
forked from noxious/server

Minor fix

This commit is contained in:
Zaxiure 2024-09-08 16:02:47 +02:00
parent 84ca1f412b
commit 756b558864
No known key found for this signature in database

View File

@ -16,7 +16,7 @@ export default class CharacterMoveEvent {
private characterMoveService: CharacterMoveService
private zoneEventTileService: ZoneEventTileService
private movementValidator: MovementValidator
private nextPath: {[index: number]: {character: ExtendedCharacter, path: {x: number, y: number}[]}} = [];
private nextPath: {[index: number]: {x: number, y: number}[]} = [];
constructor(
private readonly io: Server,
@ -47,10 +47,7 @@ export default class CharacterMoveEvent {
if(character.isMoving && !character.resetMovement) {
character.resetMovement = true;
this.nextPath[character.id] = {
character,
path
}
this.nextPath[character.id] = path;
} else {
await this.moveAlongPath(character, path)
}
@ -69,7 +66,7 @@ export default class CharacterMoveEvent {
character.isMoving = false;
character.resetMovement = false;
const nextPath = this.nextPath[character.id];
this.moveAlongPath(nextPath.character, nextPath.path);
this.moveAlongPath(character, nextPath);
break;
}