v1.2.2: fixed cases where char sprites would persist after destroyed
This commit is contained in:
parent
d580f0b9fe
commit
468b0e3c99
|
@ -161,6 +161,14 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
|
||||||
ch.updateSpriteState();
|
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
|
//used for just updating a sprite based on a given character, not linking them or placing in the game
|
||||||
public void linkVisuals( Char ch ){
|
public void linkVisuals( Char ch ){
|
||||||
//do nothin by default
|
//do nothin by default
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class GhoulSprite extends MobSprite {
|
||||||
@Override
|
@Override
|
||||||
public void move(int from, int to) {
|
public void move(int from, int to) {
|
||||||
if (parent == null){
|
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));
|
Game.reportException(new RuntimeException("ghoul sprite tried to move with null parent! ghoul HP: " + ch.HP));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user