mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-02-07 15:12:35 +01:00
Merge branch '738-bot-height' into 'dev'
Resolve "Bots ignore the height of any surface" See merge request morningstar/Arcturus-Community!275
This commit is contained in:
commit
c565092656
@ -130,12 +130,10 @@ public class BotManager {
|
|||||||
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);
|
|
||||||
|
|
||||||
double topItemHeight = 0;
|
|
||||||
if (topItem != null) topItemHeight = Item.getCurrentHeight(topItem);
|
|
||||||
roomUnit.setPreviousLocationZ(roomUnit.getCurrentLocation().getStackHeight() - topItemHeight);
|
|
||||||
|
|
||||||
|
double stackHeight = room.getStackHeight(location.x, location.y, false);
|
||||||
|
roomUnit.setPreviousLocationZ(stackHeight);
|
||||||
|
roomUnit.setZ(stackHeight);
|
||||||
|
|
||||||
roomUnit.setPathFinderRoom(room);
|
roomUnit.setPathFinderRoom(room);
|
||||||
roomUnit.setRoomUnitType(RoomUnitType.BOT);
|
roomUnit.setRoomUnitType(RoomUnitType.BOT);
|
||||||
@ -150,6 +148,8 @@ public class BotManager {
|
|||||||
habbo.getClient().sendResponse(new RemoveBotComposer(bot));
|
habbo.getClient().sendResponse(new RemoveBotComposer(bot));
|
||||||
bot.onPlace(habbo, room);
|
bot.onPlace(habbo, room);
|
||||||
|
|
||||||
|
HabboItem topItem = room.getTopItemAt(location.x, location.y);
|
||||||
|
|
||||||
if (topItem != null) {
|
if (topItem != null) {
|
||||||
try {
|
try {
|
||||||
topItem.onWalkOn(bot.getRoomUnit(), room, null);
|
topItem.onWalkOn(bot.getRoomUnit(), room, null);
|
||||||
@ -157,6 +157,7 @@ public class BotManager {
|
|||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bot.cycle(false);
|
bot.cycle(false);
|
||||||
} else {
|
} else {
|
||||||
habbo.getClient().sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FURNITURE_PLACEMENT_ERROR.key, FurnitureMovementError.NO_RIGHTS.errorCode));
|
habbo.getClient().sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FURNITURE_PLACEMENT_ERROR.key, FurnitureMovementError.NO_RIGHTS.errorCode));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user