From 1eff353254d0a3541092c883b96735098cb16556 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 22 Oct 2021 19:56:41 -0400 Subject: [PATCH] v1.1.0: fixed unblessed ankh revival rarely placing the hero on traps --- .../shatteredpixeldungeon/scenes/InterlevelScene.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index 42ff65511..2acf5b50d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -462,8 +462,9 @@ public class InterlevelScene extends PixelScene { do { Dungeon.hero.pos = level.randomRespawnCell(Dungeon.hero); tries++; - } while (level.trueDistance(invPos, Dungeon.hero.pos) <= 30 - (tries/10)); - level.plants.remove(Dungeon.hero.pos); //so the hero does not spawn on a plant + } while (level.traps.get(Dungeon.hero.pos) != null + || (level.plants.get(Dungeon.hero.pos) != null && tries < 500) + || level.trueDistance(invPos, Dungeon.hero.pos) <= 30 - (tries/10)); Dungeon.hero.resurrect(); level.drop(new LostBackpack(), invPos); }