From 73aed6726c300eb8c0db417357d8de42afda10cb Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 25 Apr 2017 14:38:52 -0400 Subject: [PATCH] v0.6.0: fixed crashes relating to random cell logic on floor 25 --- .../shatteredpixeldungeon/levels/HallsBossLevel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 4d2cda778..8b1a4262a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -167,10 +167,10 @@ public class HallsBossLevel extends Level { @Override public int randomRespawnCell() { - if (entrance == -1) return entrance; - int cell = entrance + PathFinder.NEIGHBOURS8[Random.Int(8)]; + int pos = entrance == -1 ? stairs : entrance; + int cell = pos + PathFinder.NEIGHBOURS8[Random.Int(8)]; while (!passable[cell]){ - cell = entrance + PathFinder.NEIGHBOURS8[Random.Int(8)]; + cell = pos + PathFinder.NEIGHBOURS8[Random.Int(8)]; } return cell; }