From 04addf7cbb28b78543cd8c6fca470aa20e110a98 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 2 Dec 2020 19:27:59 -0500 Subject: [PATCH] v0.9.1: added some checks to ensure things can't spawn inside of doors --- .../shatteredpixeldungeon/levels/RegularLevel.java | 7 ++++--- 1 file changed, 4 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 e8df58aa2..39ef30d49 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -216,7 +216,7 @@ public abstract class RegularLevel extends Level { do { mob.pos = pointToCell(roomToSpawn.random()); tries--; - } while (tries >= 0 && (findMob(mob.pos) != null || !passable[mob.pos] || mob.pos == exit + } while (tries >= 0 && (findMob(mob.pos) != null || !passable[mob.pos] || solid[mob.pos] || mob.pos == exit || (!openSpace[mob.pos] && mob.properties().contains(Char.Property.LARGE)))); if (tries >= 0) { @@ -231,7 +231,7 @@ public abstract class RegularLevel extends Level { do { mob.pos = pointToCell(roomToSpawn.random()); tries--; - } while (tries >= 0 && (findMob(mob.pos) != null || !passable[mob.pos] || mob.pos == exit + } while (tries >= 0 && (findMob(mob.pos) != null || !passable[mob.pos] || solid[mob.pos] || mob.pos == exit || (!openSpace[mob.pos] && mob.properties().contains(Char.Property.LARGE)))); if (tries >= 0) { @@ -272,6 +272,7 @@ public abstract class RegularLevel extends Level { if (!heroFOV[cell] && Actor.findChar( cell ) == null && passable[cell] + && !solid[cell] && (!Char.hasProp(ch, Char.Property.LARGE) || openSpace[cell]) && room.canPlaceCharacter(cellToPoint(cell), this) && cell != exit) { @@ -505,7 +506,7 @@ public abstract class RegularLevel extends Level { Room room = randomRoom( roomType ); if (room != null && room != roomEntrance) { int pos = pointToCell(room.random()); - if (passable[pos] + if (passable[pos] && !solid[pos] && pos != exit && heaps.get(pos) == null && findMob(pos) == null) {