From 193d3e54a4b3563baaf8c6cf65690386261db3d3 Mon Sep 17 00:00:00 2001 From: Yordi Date: Tue, 15 Oct 2024 17:11:37 +0200 Subject: [PATCH] Fix for bot not sitting at right height when placing on a chair #1999 --- src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java | 2 +- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index 2eebcc6f..c9b6ff29 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -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); diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 03a2f242..4cd4f86c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3635,7 +3635,7 @@ public class Room implements Comparable, 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); }