From 4ad2f689bd228580a8247ed6666b52ccc0ab2f5b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 16 Nov 2014 00:40:05 -0500 Subject: [PATCH] v0.2.2b: fixed a bug where the assassin's wound animation would sometimes cause a crash --- .../shatteredpixeldungeon/effects/Wound.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Wound.java b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Wound.java index dcc6cb3ef..6f1f98397 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Wound.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Wound.java @@ -63,10 +63,12 @@ public class Wound extends Image { } public static void hit( Char ch, float angle ) { - Wound w = (Wound)ch.sprite.parent.recycle( Wound.class ); - ch.sprite.parent.bringToFront( w ); - w.reset( ch.pos ); - w.angle = angle; + if (ch.sprite.parent != null) { + Wound w = (Wound) ch.sprite.parent.recycle(Wound.class); + ch.sprite.parent.bringToFront(w); + w.reset(ch.pos); + w.angle = angle; + } } public static void hit( int pos ) {