diff --git a/src/ts/server/serverActions.ts b/src/ts/server/serverActions.ts index 30143a2..fe69f26 100644 --- a/src/ts/server/serverActions.ts +++ b/src/ts/server/serverActions.ts @@ -290,6 +290,11 @@ export class ServerActions implements IServerActions, SocketServer { case Action.RemoveEntity: { validateNumber(param, 'param'); this.updateLastAction(); + + if (this.client.isSwitchingMap) { + return; + } + const entity = this.world.getEntityById(param | 0); if ( @@ -316,9 +321,15 @@ export class ServerActions implements IServerActions, SocketServer { this.updateLastAction(); + if (this.client.isSwitchingMap) { + return; + } + const { x, y, type } = param as { x: number; y: number; type: number; }; if ( + this.pony.options!.hold !== entities.hammer.type || + distanceXY(x, y, this.pony.x, this.pony.y) > TILE_CHANGE_RANGE || isOutsideMap(x, y, this.map) || !entities.placeableEntities.some(x => x.type === type) || !hasFlag(this.map.flags, MapFlags.EditableEntities)