forked from noxious/server
More typescript improvements
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import type { MapCacheT } from '#entities/map'
|
||||
|
||||
import { BaseEvent } from '#application/base/baseEvent'
|
||||
import { Map, MapCacheT } from '#entities/map'
|
||||
import { Map } from '#entities/map'
|
||||
|
||||
type Payload = {
|
||||
name: string
|
||||
|
@ -63,9 +63,11 @@ export default class MapUpdateEvent extends BaseEvent {
|
||||
if (data.tiles.length > data.height) {
|
||||
data.tiles = data.tiles.slice(0, data.height)
|
||||
}
|
||||
|
||||
for (let i = 0; i < data.tiles.length; i++) {
|
||||
if (data.tiles[i].length > data.width) {
|
||||
data.tiles[i] = data.tiles[i].slice(0, data.width)
|
||||
const row = data.tiles[i]
|
||||
if (row !== undefined && row.length > data.width) {
|
||||
data.tiles[i] = row.slice(0, data.width)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user