Minor movement improvements
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user