Fix for bot not sitting at right height when placing on a chair #1999

This commit is contained in:
Yordi 2024-10-15 17:11:37 +02:00
parent 0a6355996a
commit 193d3e54a4
2 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ public class BotManager {
roomUnit.setRotation(RoomUserRotation.SOUTH);
roomUnit.setLocation(location);
double stackHeight = location.getStackHeight();
double stackHeight = room.getTopHeightAt(location.x, location.y);
roomUnit.setPreviousLocationZ(stackHeight);
roomUnit.setZ(stackHeight);

View File

@ -3635,7 +3635,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
HabboItem item = this.getTopItemAt(x, y);
if (item != null)
return (item.getZ() + Item.getCurrentHeight(item));
return (item.getZ() + Item.getCurrentHeight(item) - (item.getBaseItem().allowSit() ? 1 : 0));
else
return this.layout.getHeightAtSquare(x, y);
}