Changed order or operations so Buildheight event can override max/min height of tiles

This commit is contained in:
ArpyAge 2022-04-15 01:08:23 +02:00
parent 96b5b29bed
commit 631dbe9d38

View File

@ -4732,6 +4732,9 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
}
if(height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
if(height < this.getLayout().getHeightAtSquare(tile.x, tile.y)) return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height));
if (event.hasChangedHeight()) {
@ -4739,9 +4742,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
}
if(height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
if(height < this.getLayout().getHeightAtSquare(tile.x, tile.y)) return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
item.setX(tile.x);
item.setY(tile.y);
item.setZ(height);