From 242e426b9def92c3af3877b27006e546523fa17a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 6 Jun 2023 12:09:30 -0400 Subject: [PATCH] v2.1.1: fixed shield battery being usable with an empty wand --- .../shatteredpixeldungeon/items/wands/Wand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index bc0ac67d5..56f39afd2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -579,6 +579,11 @@ public abstract class Wand extends Item { return; } + if (curWand.curCharges == 0){ + GLog.w( Messages.get(Wand.class, "fizzles") ); + return; + } + float shield = curUser.HT * (0.04f*curWand.curCharges); if (curUser.pointsInTalent(Talent.SHIELD_BATTERY) == 2) shield *= 1.5f; Buff.affect(curUser, Barrier.class).setShield(Math.round(shield));