From e853c8c6abb00a17760246ee3df7ed505dcb7170 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 21 Aug 2015 00:18:44 -0400 Subject: [PATCH] v0.3.1a: fixed crashes relating to new targeting --- .../shatteredpixeldungeon/ui/QuickSlotButton.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java index 2713d44b4..072c6d7f8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java @@ -188,13 +188,13 @@ public class QuickSlotButton extends Button implements WndBag.Listener { public static int autoAim(Char target){ //first try to directly target - if (new Ballistica(Dungeon.hero.pos, target.pos, Ballistica.PROJECTILE).collisionPos == lastTarget.pos) { + if (new Ballistica(Dungeon.hero.pos, target.pos, Ballistica.PROJECTILE).collisionPos == target.pos) { return target.pos; } //Otherwise pick nearby tiles to try and 'angle' the shot, auto-aim basically. for (int i : Level.NEIGHBOURS9DIST2) { - if (new Ballistica(Dungeon.hero.pos, lastTarget.pos+i, Ballistica.PROJECTILE).collisionPos == lastTarget.pos){ + if (new Ballistica(Dungeon.hero.pos, target.pos+i, Ballistica.PROJECTILE).collisionPos == target.pos){ return target.pos+i; } }