Fix bot placing on chairs and beds

This commit is contained in:
Alejandro 2020-02-27 23:52:40 +02:00
parent ae51fa88a5
commit 8adb814f66

View File

@ -113,15 +113,19 @@ public class BotManager {
return;
}
if (!room.hasHabbosAt(location.x, location.y) && !location.isWalkable() && location.state != RoomTileState.SIT)
if (!room.hasHabbosAt(location.x, location.y) && !location.isWalkable() && location.state != RoomTileState.SIT && location.state != RoomTileState.LAY)
return;
RoomUnit roomUnit = new RoomUnit();
roomUnit.setRotation(RoomUserRotation.SOUTH);
roomUnit.setLocation(location);
HabboItem topItem = room.getTopItemAt(location.x, location.y);
roomUnit.setZ(roomUnit.getCurrentLocation().getStackHeight());
roomUnit.setPreviousLocationZ(roomUnit.getCurrentLocation().getStackHeight());
double topItemHeight = 0;
if (topItem != null) topItemHeight = Item.getCurrentHeight(topItem);
roomUnit.setPreviousLocationZ(roomUnit.getCurrentLocation().getStackHeight() - topItemHeight);
roomUnit.setPathFinderRoom(room);
roomUnit.setRoomUnitType(RoomUnitType.BOT);
roomUnit.setCanWalk(room.isAllowBotsWalk());
@ -136,7 +140,6 @@ public class BotManager {
bot.onPlace(habbo, room);
if (topItem != null) {
roomUnit.setZ(topItem.getBaseItem().allowSit() ? topItem.getZ() : topItem.getZ() + Item.getCurrentHeight(topItem));
try {
topItem.onWalkOn(bot.getRoomUnit(), room, null);
} catch (Exception e) {