From 5eb14fc50b95d8d0ade55be9dd85a8a13faafa02 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 17 Nov 2022 13:11:37 -0500 Subject: [PATCH] v2.0.0: fixed softlocks caused by warden fadeleaf and boss levels --- .../shatteredpixeldungeon/levels/CavesBossLevel.java | 4 ++-- .../shatteredpixeldungeon/levels/CityBossLevel.java | 7 ++----- .../shatteredpixeldungeon/levels/HallsBossLevel.java | 4 ++-- .../shatteredpixeldungeon/levels/PrisonBossLevel.java | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index 5c041c4f0..a1b288d30 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -249,8 +249,6 @@ public class CavesBossLevel extends Level { @Override public void occupyCell(Char ch) { - super.occupyCell(ch); - //seal the level when the hero moves near to a pylon, the level isn't already sealed, and the gate hasn't been destroyed int gatePos = pointToCell(new Point(gate.left, gate.top)); if (ch == Dungeon.hero && !locked && solid[gatePos]){ @@ -261,6 +259,8 @@ public class CavesBossLevel extends Level { } } } + + super.occupyCell(ch); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index 66a0a8119..315c53cf8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -294,15 +294,12 @@ public class CityBossLevel extends Level { @Override public void occupyCell( Char ch ) { - - super.occupyCell( ch ); - if (map[bottomDoor] != Terrain.LOCKED_DOOR && map[topDoor] == Terrain.LOCKED_DOOR && ch.pos < bottomDoor && ch == Dungeon.hero) { - seal(); - } + + super.occupyCell( ch ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index 9c272d952..72d7ce5bb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -220,12 +220,12 @@ public class HallsBossLevel extends Level { @Override public void occupyCell( Char ch ) { - super.occupyCell( ch ); - if (map[entrance()] == Terrain.ENTRANCE && map[exit()] != Terrain.EXIT && ch == Dungeon.hero && Dungeon.level.distance(ch.pos, entrance()) >= 2) { seal(); } + + super.occupyCell( ch ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index c959bfb02..785dfc639 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -547,8 +547,6 @@ public class PrisonBossLevel extends Level { @Override public void occupyCell(Char ch) { - super.occupyCell(ch); - if (ch == Dungeon.hero){ switch (state){ case START: @@ -564,6 +562,8 @@ public class PrisonBossLevel extends Level { break; } } + + super.occupyCell(ch); } @Override