v0.6.0: fixed spawns in the entrance room, or ontop of the exit stairs
This commit is contained in:
+6
-3
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user