Fix entity placing checks

This commit is contained in:
Terncode committed 2026-11-17 18:52:40 +01:00
1 parent cc5232030f
commit 1ad7cfae4d
1 file changed
+11
+11
View File
@@ -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)