From dcf74e0d3df33224f34157fd13ae819ab71a5051 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 16 Oct 2025 13:12:42 -0400 Subject: [PATCH] v3.3.0: added some more safety checks to quickslot buttons --- .../shatteredpixeldungeon/ui/QuickSlotButton.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java index a05ce6ef8..dbc83caca 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java @@ -73,6 +73,7 @@ public class QuickSlotButton extends Button { instance = new QuickSlotButton[QuickSlot.SIZE]; lastTarget = null; + targetingSlot = -1; } @Override @@ -85,7 +86,7 @@ public class QuickSlotButton extends Button { if (!Dungeon.hero.isAlive() || !Dungeon.hero.ready){ return; } - if (targetingSlot == slotNum) { + if (targetingSlot == slotNum && lastTarget != null) { int cell = autoAim(lastTarget, select(slotNum)); if (cell != -1){ @@ -349,7 +350,7 @@ public class QuickSlotButton extends Button { //FIXME: this is currently very expensive, should either optimize ballistica or this, or both public static int autoAim(Char target, Item item){ - if (Dungeon.hero == null){ + if (Dungeon.hero == null || target == null){ return -1; }