forked from noxious/server
Converted more procedural programming to OOP
This commit is contained in:
@ -65,15 +65,19 @@ export default class CharacterMove {
|
||||
break
|
||||
}
|
||||
|
||||
this.characterService.updatePosition(character, end)
|
||||
// Send minimal data
|
||||
// Update position first
|
||||
character.positionX = end.x
|
||||
character.positionY = end.y
|
||||
|
||||
// Then emit with the same properties
|
||||
this.io.in(character.zone!.id.toString()).emit('character:move', {
|
||||
id: character.id,
|
||||
positionX: end.x,
|
||||
positionY: end.y,
|
||||
positionX: character.positionX,
|
||||
positionY: character.positionY,
|
||||
rotation: character.rotation,
|
||||
isMoving: true
|
||||
})
|
||||
|
||||
await this.characterService.applyMovementDelay()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user