From 0904b3f8acdbb6114732c7d30e2d724e2e199605 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 10 Aug 2021 20:33:54 -0400 Subject: [PATCH] v0.9.4: fixed ankh windows appearing when they shouldn't in some cases --- .../shatteredpixeldungeon/scenes/GameScene.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 093383903..43758f3f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -45,6 +45,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText; import com.shatteredpixel.shatteredpixeldungeon.effects.Ripple; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; +import com.shatteredpixel.shatteredpixeldungeon.items.Ankh; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -545,9 +546,18 @@ public class GameScene extends PixelScene { fadeIn(); - //assume the hero died with an ankh + //re-show WndResurrect if needed if (!Dungeon.hero.isAlive()){ - add(new WndResurrect()); + //check if hero has an unblessed ankh + boolean hasAnkh = false; + for (Ankh i : Dungeon.hero.belongings.getAllItems(Ankh.class)){ + if (!i.isBlessed()){ + hasAnkh = true; + } + } + if (hasAnkh) { + add(new WndResurrect()); + } } }