v2.1.0: mobs no longer randomly spawn on plants or traps
This commit is contained in:
+7
-1
@@ -238,6 +238,7 @@ public abstract class RegularLevel extends Level {
|
|||||||
|| solid[mob.pos]
|
|| solid[mob.pos]
|
||||||
|| !roomToSpawn.canPlaceCharacter(cellToPoint(mob.pos), this)
|
|| !roomToSpawn.canPlaceCharacter(cellToPoint(mob.pos), this)
|
||||||
|| mob.pos == exit()
|
|| mob.pos == exit()
|
||||||
|
|| traps.get(mob.pos) != null || plants.get(mob.pos) != null
|
||||||
|| (!openSpace[mob.pos] && mob.properties().contains(Char.Property.LARGE))));
|
|| (!openSpace[mob.pos] && mob.properties().contains(Char.Property.LARGE))));
|
||||||
|
|
||||||
if (tries >= 0) {
|
if (tries >= 0) {
|
||||||
@@ -252,7 +253,12 @@ public abstract class RegularLevel extends Level {
|
|||||||
do {
|
do {
|
||||||
mob.pos = pointToCell(roomToSpawn.random());
|
mob.pos = pointToCell(roomToSpawn.random());
|
||||||
tries--;
|
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))));
|
|| (!openSpace[mob.pos] && mob.properties().contains(Char.Property.LARGE))));
|
||||||
|
|
||||||
if (tries >= 0) {
|
if (tries >= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user