From 2c9156e59189f6bc96964cb596a3a9283435e852 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 12 Oct 2017 16:13:37 -0400 Subject: [PATCH] v0.6.2: fixed a rare crash with cursed wands --- .../shatteredpixeldungeon/items/wands/CursedWand.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java index fbcbb4aeb..e11ffdad0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java @@ -153,7 +153,10 @@ public class CursedWand { cursedFX(user, bolt, new Callback() { public void call() { Char ch = Actor.findChar( bolt.collisionPos ); - if (ch != null && !ch.properties().contains(Char.Property.IMMOVABLE)) { + if (ch == user){ + ScrollOfTeleportation.teleportHero(user); + wand.wandUsed(); + } else if (ch != null && !ch.properties().contains(Char.Property.IMMOVABLE)) { int count = 10; int pos; do { @@ -166,7 +169,7 @@ public class CursedWand { GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); } else { ch.pos = pos; - if (((Mob) ch).state == ((Mob) ch).HUNTING) ((Mob) ch).state = ((Mob) ch).WANDERING; + if (((Mob) ch).state == ((Mob) ch).HUNTING)((Mob) ch).state = ((Mob) ch).WANDERING; ch.sprite.place(ch.pos); ch.sprite.visible = Dungeon.level.heroFOV[pos]; }