From ec2ba6afca74ecfb8c77727c510f26b4533be69a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 24 Mar 2015 02:44:16 -0400 Subject: [PATCH] v0.3.0: self-targeting with wands is now impossible --- .../shatteredpixeldungeon/items/wands/Wand.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index b7cc7b121..2ce3b35b6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -422,17 +422,17 @@ public abstract class Wand extends KindOfWeapon { public void onSelect( Integer target ) { if (target != null) { + + final Wand curWand = (Wand)Wand.curItem; + + final int cell = Ballistica.cast( curUser.pos, target, true, curWand.hitChars ); - if (target == curUser.pos) { + if (target == curUser.pos || cell == curUser.pos) { GLog.i( TXT_SELF_TARGET ); return; } - final Wand curWand = (Wand)Wand.curItem; - curWand.setKnown(); - - final int cell = Ballistica.cast( curUser.pos, target, true, curWand.hitChars ); curUser.sprite.zap( cell ); //targets the enemy hit for char-hitting wands, or the cell aimed at for other wands. @@ -441,7 +441,7 @@ public abstract class Wand extends KindOfWeapon { if (curWand.curCharges > 0) { curUser.busy(); - + curWand.fx( cell, new Callback() { @Override public void call() {