v0.3.2a: weak floor rooms now guarantee a pit below them

This commit is contained in:
Evan Debenham 2015-11-06 17:13:15 -05:00 committed by Evan Debenham
parent 3a5f724000
commit b5176de721

View File

@ -200,6 +200,7 @@ public abstract class RegularLevel extends Level {
protected boolean assignRoomType() { protected boolean assignRoomType() {
int specialRooms = 0; int specialRooms = 0;
boolean pitMade = false;
for (Room r : rooms) { for (Room r : rooms) {
if (r.type == Type.NULL && if (r.type == Type.NULL &&
@ -212,7 +213,7 @@ public abstract class RegularLevel extends Level {
if (pitRoomNeeded) { if (pitRoomNeeded) {
r.type = Type.PIT; r.type = Type.PIT;
pitRoomNeeded = false; pitMade = true;
specials.remove( Type.ARMORY ); specials.remove( Type.ARMORY );
specials.remove( Type.CRYPT ); specials.remove( Type.CRYPT );
@ -262,6 +263,8 @@ public abstract class RegularLevel extends Level {
} }
} }
} }
if (pitRoomNeeded && !pitMade) return false;
int count = 0; int count = 0;
for (Room r : rooms) { for (Room r : rooms) {