Merge branch 'fix-height-bot-onplace' into 'ms4/dev'

Fix for bot not sitting at right height when placing on a chair, fixes issue #1999

See merge request morningstar/Arcturus-Community!41
This commit is contained in:
John 2023-01-16 23:05:17 +00:00
commit 0f3ca7807e
2 changed files with 5 additions and 5 deletions

View File

@ -122,7 +122,7 @@ public class BotManager {
roomUnit.setRotation(RoomUserRotation.SOUTH);
roomUnit.setLocation(location);
double stackHeight = location.getStackHeight();
double stackHeight = room.getTopHeightAt(location.getX(), location.getY());
roomUnit.setPreviousLocationZ(stackHeight);
roomUnit.setZ(stackHeight);

View File

@ -3063,11 +3063,11 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
public double getTopHeightAt(int x, int y) {
HabboItem item = this.getTopItemAt(x, y);
if (item != null)
return (item.getZ() + Item.getCurrentHeight(item));
else
if (item != null) {
return (item.getZ() + Item.getCurrentHeight(item) - (item.getBaseItem().allowSit() ? 1 : 0));
} else {
return this.layout.getHeightAtSquare(x, y);
}
}
public HabboItem getLowestChair(RoomTile tile) {