From 2e2d7ae96cf81bb237678d78acd046fe4176b23d Mon Sep 17 00:00:00 2001 From: Breno Andrade <59066707+brenoepics@users.noreply.github.com> Date: Thu, 7 Apr 2022 21:42:59 -0300 Subject: [PATCH] Fix pets and bots invalid tiles --- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 09c54558..c8d41847 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -475,7 +475,8 @@ public class Room implements Comparable, ISerialize, Runnable { b.setRoomUnit(new RoomUnit()); b.getRoomUnit().setPathFinderRoom(this); b.getRoomUnit().setLocation(this.layout.getTile((short) set.getInt("x"), (short) set.getInt("y"))); - if (b.getRoomUnit().getCurrentLocation() == null) { + if (b.getRoomUnit().getCurrentLocation() == null || b.getRoomUnit().getCurrentLocation().state == RoomTileState.INVALID) { + b.getRoomUnit().setZ(this.getLayout().getDoorTile().getStackHeight()); b.getRoomUnit().setLocation(this.getLayout().getDoorTile()); b.getRoomUnit().setRotation(RoomUserRotation.fromValue(this.getLayout().getDoorDirection())); } else { @@ -510,7 +511,8 @@ public class Room implements Comparable, ISerialize, Runnable { pet.setRoomUnit(new RoomUnit()); pet.getRoomUnit().setPathFinderRoom(this); pet.getRoomUnit().setLocation(this.layout.getTile((short) set.getInt("x"), (short) set.getInt("y"))); - if (pet.getRoomUnit().getCurrentLocation() == null) { + if (pet.getRoomUnit().getCurrentLocation() == null || pet.getRoomUnit().getCurrentLocation().state == RoomTileState.INVALID) { + pet.getRoomUnit().setZ(this.getLayout().getDoorTile().getStackHeight()); pet.getRoomUnit().setLocation(this.getLayout().getDoorTile()); pet.getRoomUnit().setRotation(RoomUserRotation.fromValue(this.getLayout().getDoorDirection())); } else {