Small improvement teleports
This commit is contained in:
@ -48,6 +48,7 @@ class CharacterTeleportService {
|
||||
|
||||
try {
|
||||
const currentMapId = mapCharacter.character.map?.id
|
||||
const currentMap = MapManager.getMapById(currentMapId!)
|
||||
const io = SocketManager.getIO()
|
||||
|
||||
// Update character position and map
|
||||
@ -67,9 +68,9 @@ class CharacterTeleportService {
|
||||
}
|
||||
|
||||
// Handle current map cleanup
|
||||
if (currentMapId) {
|
||||
if (currentMapId && currentMap) {
|
||||
socket.leave(currentMapId)
|
||||
MapManager.removeCharacter(characterId)
|
||||
await currentMap.removeCharacter(characterId)
|
||||
io.in(currentMapId).emit(SocketEvent.MAP_CHARACTER_LEAVE, characterId)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user