From 76bd7b8d1519ddb5fb9355327e57964f13084e3e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 12 Aug 2021 13:09:20 -0400 Subject: [PATCH] v0.9.4: fixed crashes if hero ankhs without a holster in inventory --- .../shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java | 2 +- .../shatteredpixeldungeon/items/LostBackpack.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 4236742f7..7f3159a32 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -2006,7 +2006,7 @@ public class Hero extends Char { } else if (i instanceof CloakOfShadows && i.keptThoughLostInvent && hasTalent(Talent.LIGHT_CLOAK)){ ((CloakOfShadows) i).activate(this); } else if (i instanceof Wand && i.keptThoughLostInvent){ - if (holster.contains(i)){ + if (holster != null && holster.contains(i)){ ((Wand) i).charge(this, MagicalHolster.HOLSTER_SCALE_FACTOR); } else { ((Wand) i).charge(this); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java index c1071adf9..cd68077b9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java @@ -38,7 +38,7 @@ public class LostBackpack extends Item { } else if ( i instanceof CloakOfShadows && hero.hasTalent(Talent.LIGHT_CLOAK)){ ((CloakOfShadows) i).activate(hero); } else if (i instanceof Wand){ - if (holster.contains(i)){ + if (holster != null && holster.contains(i)){ ((Wand) i).charge(hero, MagicalHolster.HOLSTER_SCALE_FACTOR); } else { ((Wand) i).charge(hero);