1
0
forked from noxious/server

Converted more procedural programming to OOP

This commit is contained in:
2024-12-26 23:34:25 +01:00
parent b7f448cb17
commit e571cf2230
46 changed files with 449 additions and 382 deletions

View File

@ -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()
}