From bd52f7322d9b4037e0de7204cb1b35057a8d8eb7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 22 Apr 2017 13:46:41 -0400 Subject: [PATCH] v0.6.0: fixed spawns in the entrance room, or ontop of the exit stairs --- .../shatteredpixeldungeon/levels/RegularLevel.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index d10d3838c..0ced8e63c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -234,12 +234,15 @@ public abstract class RegularLevel extends Level { } Room room = randomRoom( StandardRoom.class ); - if (room == null) { + if (room == null || room == roomEntrance) { continue; } 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; } @@ -364,7 +367,7 @@ public abstract class RegularLevel extends Level { Room room = randomRoom( StandardRoom.class ); if (room != null && room != roomEntrance) { int pos = pointToCell(room.random()); - if (passable[pos]) { + if (passable[pos] && pos != exit) { return pos; } }