v0.6.0: fixed spawns in the entrance room, or ontop of the exit stairs

This commit is contained in:
Evan Debenham 2017-04-22 13:46:41 -04:00
parent 63752b11e9
commit bd52f7322d

View File

@ -234,12 +234,15 @@ public abstract class RegularLevel extends Level {
} }
Room room = randomRoom( StandardRoom.class ); Room room = randomRoom( StandardRoom.class );
if (room == null) { if (room == null || room == roomEntrance) {
continue; continue;
} }
cell = pointToCell(room.random()); cell = pointToCell(room.random());
if (!Dungeon.visible[cell] && Actor.findChar( cell ) == null && Level.passable[cell]) { if (!Dungeon.visible[cell]
&& Actor.findChar( cell ) == null
&& Level.passable[cell]
&& cell != exit) {
return cell; return cell;
} }
@ -364,7 +367,7 @@ public abstract class RegularLevel extends Level {
Room room = randomRoom( StandardRoom.class ); Room room = randomRoom( StandardRoom.class );
if (room != null && room != roomEntrance) { if (room != null && room != roomEntrance) {
int pos = pointToCell(room.random()); int pos = pointToCell(room.random());
if (passable[pos]) { if (passable[pos] && pos != exit) {
return pos; return pos;
} }
} }