From 1c303a29fd67c1038eaea059577192e21967dd0a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 3 Nov 2016 00:43:39 -0400 Subject: [PATCH] v0.4.3b: adjusted how emo icons are handled to reduce null pointers --- .../shatteredpixeldungeon/sprites/CharSprite.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java index 7e8a9fa19..4dfcf9f2a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java @@ -397,7 +397,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip } else { hideSleep(); } - if (emo != null) { + if (emo != null && emo.alive) { emo.visible = visible; } } @@ -418,7 +418,6 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip public void hideSleep() { if (emo instanceof EmoIcon.Sleep) { emo.killAndErase(); - emo = null; } } @@ -437,7 +436,6 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip public void hideAlert() { if (emo instanceof EmoIcon.Alert) { emo.killAndErase(); - emo = null; } } @@ -447,7 +445,6 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip if (emo != null) { emo.killAndErase(); - emo = null; } }