Fix NullPointerException in Room.java

This commit is contained in:
Alejandro 2019-06-11 17:08:36 +03:00
parent 6a2334ee89
commit 7697765a5c

View File

@ -3633,7 +3633,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
public RoomTile getRandomWalkableTile() {
for (int i = 0; i < 10; i++) {
RoomTile tile = this.layout.getTile((short) (Math.random() * this.layout.getMapSizeX()), (short) (Math.random() * this.layout.getMapSizeY()));
if (tile.isWalkable()) {
if (tile != null && tile.isWalkable()) {
return tile;
}
}