v0.6.1: fixed rare problematic enemy and npc placement

This commit is contained in:
Evan Debenham
2017-07-12 00:11:42 -04:00
parent 6fd5de91c7
commit be396f4e2d
2 changed files with 8 additions and 3 deletions
@@ -276,7 +276,12 @@ public abstract class RegularLevel extends Level {
continue;
}
cell = pointToCell(room.random());
//if we can avoid it, don't place along the perimiter
if (room.width() >= 6 && room.height() >= 6) {
cell = pointToCell(room.random(2));
} else {
cell = pointToCell(room.random(1));
}
if (!Dungeon.visible[cell]
&& Actor.findChar( cell ) == null
&& Level.passable[cell]
@@ -33,12 +33,12 @@ public class PlatformRoom extends StandardRoom {
@Override
public int minWidth() {
return Math.max(super.minWidth(), 5);
return Math.max(super.minWidth(), 6);
}
@Override
public int minHeight() {
return Math.max(super.minHeight(), 5);
return Math.max(super.minHeight(), 6);
}
@Override