Minor movement improvements

This commit is contained in:
2025-02-16 18:16:17 +01:00
parent d68d307895
commit f2dd1a2ffe
3 changed files with 10 additions and 11 deletions

View File

@ -6,6 +6,7 @@ import MapManager from '@/managers/mapManager'
import SocketManager from '@/managers/socketManager'
import MapCharacter from '@/models/mapCharacter'
import MapRepository from '@/repositories/mapRepository'
import CharacterMoveService from '@/services/characterMoveService'
interface TeleportOptions {
targetMapId: UUID
@ -61,13 +62,7 @@ class CharacterTeleportService {
// If the current map is the target map and we are not joining, send move event
if (currentMapId === options.targetMapId && !options.isInitialJoin) {
// If the current map is the target map, send move event
io.in(currentMapId).emit(SocketEvent.MAP_CHARACTER_MOVE, {
characterId: mapCharacter.character.id,
positionX: options.targetX,
positionY: options.targetY,
rotation: options.rotation ?? 0,
isMoving: false
})
CharacterMoveService.broadcastMovement(mapCharacter.character, false)
return true
}