v0.2.2b: fixed a bug where the assassin's wound animation would sometimes cause a crash

This commit is contained in:
Evan Debenham 2014-11-16 00:40:05 -05:00
parent 402f61aa76
commit 4ad2f689bd

View File

@ -63,11 +63,13 @@ 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 );
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 ) {
hit( pos, 0 );