Fix NullPointerException in RoomUnit canOverrideTile

This commit is contained in:
Alejandro 2019-05-26 19:31:14 +03:00
parent 8dda7e8111
commit 6caadebe33

View File

@ -806,6 +806,8 @@ public class RoomUnit
}
public boolean canOverrideTile(RoomTile tile) {
if (tile == null || room == null || room.getLayout() == null) return false;
int tileIndex = (room.getLayout().getMapSizeY() * tile.y) + tile.x + 1;
return this.overridableTiles.contains(tileIndex);
}