v1.2.2: fixed cases where char sprites would persist after destroyed
This commit is contained in:
parent
d580f0b9fe
commit
468b0e3c99
|
@ -160,7 +160,15 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
|
|||
|
||||
ch.updateSpriteState();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
super.destroy();
|
||||
if (ch != null && ch.sprite == this){
|
||||
ch.sprite = null;
|
||||
}
|
||||
}
|
||||
|
||||
//used for just updating a sprite based on a given character, not linking them or placing in the game
|
||||
public void linkVisuals( Char ch ){
|
||||
//do nothin by default
|
||||
|
|
|
@ -62,7 +62,7 @@ public class GhoulSprite extends MobSprite {
|
|||
@Override
|
||||
public void move(int from, int to) {
|
||||
if (parent == null){
|
||||
//fixme this happens rarely, likely due to ghoul life link?
|
||||
//TODO this should be fixed as of v1.2.2, monitor for more reports and remove if we're clear
|
||||
Game.reportException(new RuntimeException("ghoul sprite tried to move with null parent! ghoul HP: " + ch.HP));
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user