diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/CavesPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/CavesPainter.java index 5615f2d35..613bfcf67 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/CavesPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/CavesPainter.java @@ -60,7 +60,8 @@ public class CavesPainter extends RegularPainter { if (Random.Int( s ) > 8) { int corner = (room.left + 1) + (room.top + 1) * w; - if (map[corner - 1] == Terrain.WALL && map[corner - w] == Terrain.WALL) { + if (map[corner-1] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner-1)) + && map[corner-w] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner-w))) { map[corner] = Terrain.WALL; level.traps.remove(corner); } @@ -68,7 +69,8 @@ public class CavesPainter extends RegularPainter { if (Random.Int( s ) > 8) { int corner = (room.right - 1) + (room.top + 1) * w; - if (map[corner + 1] == Terrain.WALL && map[corner - w] == Terrain.WALL) { + if (map[corner+1] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner+1)) + && map[corner-w] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner-w))) { map[corner] = Terrain.WALL; level.traps.remove(corner); } @@ -76,7 +78,8 @@ public class CavesPainter extends RegularPainter { if (Random.Int( s ) > 8) { int corner = (room.left + 1) + (room.bottom - 1) * w; - if (map[corner - 1] == Terrain.WALL && map[corner + w] == Terrain.WALL) { + if (map[corner-1] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner-1)) + && map[corner+w] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner+w))) { map[corner] = Terrain.WALL; level.traps.remove(corner); } @@ -84,7 +87,8 @@ public class CavesPainter extends RegularPainter { if (Random.Int( s ) > 8) { int corner = (room.right - 1) + (room.bottom - 1) * w; - if (map[corner + 1] == Terrain.WALL && map[corner + w] == Terrain.WALL) { + if (map[corner+1] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner+1)) + && map[corner+w] == Terrain.WALL && !room.connected.containsValue(level.cellToPoint(corner+w))) { map[corner] = Terrain.WALL; level.traps.remove(corner); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MiningLevelPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MiningLevelPainter.java index 7eeb1fa16..0fdbc2606 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MiningLevelPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MiningLevelPainter.java @@ -49,16 +49,6 @@ public class MiningLevelPainter extends CavesPainter { @Override protected void generateGold(Level level, ArrayList rooms) { - - //replace all hidden doors with wall - // we do this here so that levels can still know where hidden passages are until the end - // but said passages can also sometimes have gold in them - for (int i = 0; i < level.length(); i++) { - if (level.map[i] == Terrain.SECRET_DOOR) { - level.map[i] = Terrain.WALL; - } - } - //we start by counting all the gold purposefully made by rooms for (int i = 0; i < level.length(); i++){ if (level.map[i] == Terrain.WALL_DECO) { @@ -131,7 +121,7 @@ public class MiningLevelPainter extends CavesPainter { int door = d.x + d.y * l.width(); if (d.type == Room.Door.Type.HIDDEN){ - l.map[door] = Terrain.SECRET_DOOR; + l.map[door] = Terrain.WALL; } else { //some of these are randomly hidden, using the same rules as regular levels if (Random.Float() < hiddenDoorChance) {