Cleanup
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import type { MapCacheT } from '@/entities/map'
|
||||
|
||||
import { BaseEvent } from '@/application/base/baseEvent'
|
||||
import { SocketEvent } from '@/application/enums'
|
||||
import type { MapCacheT } from '@/entities/map'
|
||||
import { Map } from '@/entities/map'
|
||||
|
||||
type Payload = {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import type { UUID } from '@/application/types'
|
||||
|
||||
import { BaseEvent } from '@/application/base/baseEvent'
|
||||
import { SocketEvent } from '@/application/enums'
|
||||
import type { UUID } from '@/application/types'
|
||||
import MapRepository from '@/repositories/mapRepository'
|
||||
|
||||
type Payload = {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import type { UUID } from '@/application/types'
|
||||
|
||||
import { BaseEvent } from '@/application/base/baseEvent'
|
||||
import { SocketEvent } from '@/application/enums'
|
||||
import type { UUID } from '@/application/types'
|
||||
import { Map } from '@/entities/map'
|
||||
import MapRepository from '@/repositories/mapRepository'
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
import type { UUID } from '@/application/types'
|
||||
|
||||
import { BaseEvent } from '@/application/base/baseEvent'
|
||||
import { SocketEvent } from '@/application/enums'
|
||||
import { MapEventTileType } from '@/application/enums'
|
||||
import { MapEventTileType, SocketEvent } from '@/application/enums'
|
||||
import type { UUID } from '@/application/types'
|
||||
import { Map } from '@/entities/map'
|
||||
import { MapEffect } from '@/entities/mapEffect'
|
||||
import { MapEventTile } from '@/entities/mapEventTile'
|
||||
@ -87,7 +85,7 @@ export default class MapUpdateEvent extends BaseEvent {
|
||||
|
||||
if (tile.teleport) {
|
||||
const teleport = new MapEventTileTeleport()
|
||||
.setToMap((await mapRepository.getById(tile.teleport.toMap.id))!)
|
||||
.setToMap(await mapRepository.getById(tile.teleport.toMap.id))
|
||||
.setToPositionX(tile.teleport.toPositionX)
|
||||
.setToPositionY(tile.teleport.toPositionY)
|
||||
.setToRotation(tile.teleport.toRotation)
|
||||
@ -117,7 +115,7 @@ export default class MapUpdateEvent extends BaseEvent {
|
||||
|
||||
// Reload map from database to get fresh data
|
||||
map = await mapRepository.getById(data.mapId)
|
||||
await mapRepository.getEntityManager().populate(map!, mapRepository.POPULATE_MAP_EDITOR as any)
|
||||
await mapRepository.getEntityManager().populate(map, mapRepository.POPULATE_MAP_EDITOR as any)
|
||||
|
||||
if (!map) {
|
||||
this.logger.info(`User ${character!.getId()} tried to update map ${data.mapId} but it does not exist after update.`)
|
||||
|
Reference in New Issue
Block a user