This commit is contained in:
2025-02-12 00:50:51 +01:00
parent c47339dfcd
commit e40a56825a
121 changed files with 468 additions and 3305 deletions

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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'

View File

@ -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.`)