v2.1.0: mobs no longer randomly spawn on plants or traps

This commit is contained in:
Evan Debenham
2023-04-19 15:10:14 -04:00
parent 50fc21e2ca
commit 2a4e7c5e55
@@ -238,6 +238,7 @@ public abstract class RegularLevel extends Level {
|| solid[mob.pos]
|| !roomToSpawn.canPlaceCharacter(cellToPoint(mob.pos), this)
|| mob.pos == exit()
|| traps.get(mob.pos) != null || plants.get(mob.pos) != null
|| (!openSpace[mob.pos] && mob.properties().contains(Char.Property.LARGE))));
if (tries >= 0) {
@@ -252,7 +253,12 @@ public abstract class RegularLevel extends Level {
do {
mob.pos = pointToCell(roomToSpawn.random());
tries--;
} while (tries >= 0 && (findMob(mob.pos) != null || !passable[mob.pos] || solid[mob.pos] || mob.pos == exit()
} while (tries >= 0 && (findMob(mob.pos) != null
|| !passable[mob.pos]
|| solid[mob.pos]
|| !roomToSpawn.canPlaceCharacter(cellToPoint(mob.pos), this)
|| mob.pos == exit()
|| traps.get(mob.pos) != null || plants.get(mob.pos) != null
|| (!openSpace[mob.pos] && mob.properties().contains(Char.Property.LARGE))));
if (tries >= 0) {