mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-12-03 05:10:04 +01:00
Fix entity placing checks
This commit is contained in:
1 parent
cc5232030f
commit
1ad7cfae4d
1 file changed
+11
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user