From be836db8a1f6145816ebab028ef0422624b54326 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 13 Oct 2014 23:07:57 -0400 Subject: [PATCH] V0.2.1a: HOTFIX commit, corrected sewer boss map generation issue (note to self - a character should never under any circumstances be able to walk into the outer ring of the map) --- .../shatteredpixeldungeon/levels/SewerBossLevel.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java index fae9006c8..2dda8a00a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java @@ -64,13 +64,13 @@ public class SewerBossLevel extends RegularLevel { int retry = 0; //start with finding an entrance room (will also contain exit) - //the room must be at least 4x4 and be at the top of the map(so that nothing can connect with the top) + //the room must be at least 4x4 and be nearer the top of the map(so that it is less likely something connects to the top) do { if (retry++ > 20) { return false; } roomEntrance = Random.element( rooms ); - } while (roomEntrance.width() < 4 || roomEntrance.height() < 4 || roomEntrance.top != 0); + } while (roomEntrance.width() < 4 || roomEntrance.height() < 4 || roomEntrance.top == 0 || roomEntrance.top >= 12); roomEntrance.type = Type.ENTRANCE; roomExit = roomEntrance; @@ -151,6 +151,12 @@ public class SewerBossLevel extends RegularLevel { r.type = Type.TUNNEL; } } + + //make sure nothing is connecting at the top of the entrance, this would be bad. + for (Room r : roomEntrance.neigbours){ + if (r.bottom == roomEntrance.top && r.type != Type.NULL) + return false; + } paint();