From 56f1e0e54d7f7e47ccf085c5c5dd32abcd5bb836 Mon Sep 17 00:00:00 2001 From: KrewsOrg Date: Tue, 7 May 2019 23:45:32 +0100 Subject: [PATCH] Bot Height is now fixed on placing on rooms with multiple z heights. Sitting is also fixed in the same regard --- .../java/com/eu/habbo/habbohotel/bots/BotManager.java | 8 +++----- 1 file changed, 3 insertions(+), 5 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 e762df0e..f1208640 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -144,11 +144,8 @@ public class BotManager roomUnit.setRotation(RoomUserRotation.SOUTH); roomUnit.setLocation(location); HabboItem topItem = room.getTopItemAt(location.x, location.y); - - if (topItem != null ) - roomUnit.setZ(topItem.getBaseItem().allowSit() ? topItem.getZ() : topItem.getZ() + Item.getCurrentHeight(topItem)); - - roomUnit.setPreviousLocationZ(roomUnit.getZ()); + roomUnit.setZ(roomUnit.getCurrentLocation().getStackHeight()); + roomUnit.setPreviousLocationZ(roomUnit.getCurrentLocation().getStackHeight()); roomUnit.setPathFinderRoom(room); roomUnit.setRoomUnitType(RoomUnitType.BOT); roomUnit.setCanWalk(room.isAllowBotsWalk()); @@ -164,6 +161,7 @@ public class BotManager if (topItem != null) { + roomUnit.setZ(topItem.getBaseItem().allowSit() ? topItem.getZ() : topItem.getZ() + Item.getCurrentHeight(topItem)); try { topItem.onWalkOn(bot.getRoomUnit(), room, null);