forked from noxious/server
Silly typescript
This commit is contained in:
parent
5acebfe377
commit
daeb232d3b
@ -36,7 +36,7 @@ class CharacterTeleportService {
|
|||||||
|
|
||||||
const existingCharacter = !options.isInitialJoin && MapManager.getCharacterById(characterId)
|
const existingCharacter = !options.isInitialJoin && MapManager.getCharacterById(characterId)
|
||||||
const mapCharacter = options.isInitialJoin
|
const mapCharacter = options.isInitialJoin
|
||||||
? new MapCharacter(options.character)
|
? new MapCharacter(options.character!)
|
||||||
: existingCharacter ||
|
: existingCharacter ||
|
||||||
(() => {
|
(() => {
|
||||||
this.logger.error(`Teleport failed - Character ${characterId} not found in MapManager`)
|
this.logger.error(`Teleport failed - Character ${characterId} not found in MapManager`)
|
||||||
@ -83,7 +83,7 @@ class CharacterTeleportService {
|
|||||||
targetMap.addCharacter(mapCharacter.getCharacter())
|
targetMap.addCharacter(mapCharacter.getCharacter())
|
||||||
|
|
||||||
const map = await mapRepository.getById(options.targetMapId)
|
const map = await mapRepository.getById(options.targetMapId)
|
||||||
await mapRepository.getEntityManager().populate(map, mapRepository.POPULATE_TELEPORT as any)
|
await mapRepository.getEntityManager().populate(map!, mapRepository.POPULATE_TELEPORT as any)
|
||||||
|
|
||||||
// Notify clients
|
// Notify clients
|
||||||
io.in(options.targetMapId).emit(SocketEvent.MAP_CHARACTER_JOIN, mapCharacter)
|
io.in(options.targetMapId).emit(SocketEvent.MAP_CHARACTER_JOIN, mapCharacter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user