mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Ensure that potential adjacent tiles are not null (puzzlebox)
This commit is contained in:
parent
a5f4df51ac
commit
be6b206211
@ -53,7 +53,7 @@ public class InteractionPuzzleBox extends HabboItem {
|
|||||||
room.getLayout().getTileInFront(room.getLayout().getTile(this.getX(), this.getY()), RoomUserRotation.WEST.getValue())
|
room.getLayout().getTileInFront(room.getLayout().getTile(this.getX(), this.getY()), RoomUserRotation.WEST.getValue())
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.filter(t -> t.isWalkable() && !room.hasHabbosAt(t.x, t.y))
|
.filter(t -> t != null && t.isWalkable() && !room.hasHabbosAt(t.x, t.y))
|
||||||
.min(Comparator.comparingDouble(a -> a.distance(client.getHabbo().getRoomUnit().getCurrentLocation())));
|
.min(Comparator.comparingDouble(a -> a.distance(client.getHabbo().getRoomUnit().getCurrentLocation())));
|
||||||
|
|
||||||
nearestTile.ifPresent(roomTile -> client.getHabbo().getRoomUnit().setGoalLocation(roomTile));
|
nearestTile.ifPresent(roomTile -> client.getHabbo().getRoomUnit().setGoalLocation(roomTile));
|
||||||
|
Loading…
Reference in New Issue
Block a user