mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 12:22:36 +01:00
Fix bot placing on chairs and beds
This commit is contained in:
parent
ae51fa88a5
commit
8adb814f66
@ -113,15 +113,19 @@ public class BotManager {
|
|||||||
return;
|
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;
|
return;
|
||||||
|
|
||||||
RoomUnit roomUnit = new RoomUnit();
|
RoomUnit roomUnit = new RoomUnit();
|
||||||
roomUnit.setRotation(RoomUserRotation.SOUTH);
|
roomUnit.setRotation(RoomUserRotation.SOUTH);
|
||||||
roomUnit.setLocation(location);
|
roomUnit.setLocation(location);
|
||||||
HabboItem topItem = room.getTopItemAt(location.x, location.y);
|
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.setPathFinderRoom(room);
|
||||||
roomUnit.setRoomUnitType(RoomUnitType.BOT);
|
roomUnit.setRoomUnitType(RoomUnitType.BOT);
|
||||||
roomUnit.setCanWalk(room.isAllowBotsWalk());
|
roomUnit.setCanWalk(room.isAllowBotsWalk());
|
||||||
@ -136,7 +140,6 @@ public class BotManager {
|
|||||||
bot.onPlace(habbo, room);
|
bot.onPlace(habbo, room);
|
||||||
|
|
||||||
if (topItem != null) {
|
if (topItem != null) {
|
||||||
roomUnit.setZ(topItem.getBaseItem().allowSit() ? topItem.getZ() : topItem.getZ() + Item.getCurrentHeight(topItem));
|
|
||||||
try {
|
try {
|
||||||
topItem.onWalkOn(bot.getRoomUnit(), room, null);
|
topItem.onWalkOn(bot.getRoomUnit(), room, null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user