Merge branch 'bugfix/vendingmachine-npe' into 'dev'

Fixed NPE when a vendingmachine is facing a wall where the user can't reach it

See merge request morningstar/Arcturus-Community!299
This commit is contained in:
Harmonic 2020-09-22 15:35:14 -04:00
commit c270c46c13

View File

@ -34,8 +34,12 @@ public class InteractionVendingMachine extends HabboItem {
} }
public THashSet<RoomTile> getActivatorTiles(Room room) { public THashSet<RoomTile> getActivatorTiles(Room room) {
THashSet<RoomTile> tiles = new THashSet<RoomTile>(); THashSet<RoomTile> tiles = new THashSet<>();
tiles.add(getSquareInFront(room.getLayout(), this)); RoomTile tileInFront = getSquareInFront(room.getLayout(), this);
if (tileInFront != null)
tiles.add(tileInFront);
tiles.add(room.getLayout().getTile(this.getX(), this.getY())); tiles.add(room.getLayout().getTile(this.getX(), this.getY()));
return tiles; return tiles;
} }