v0.9.1c: improved animation autocomplete when charsprites are paused

This commit is contained in:
Evan Debenham 2021-01-09 22:49:58 -05:00
parent b4c2f71daa
commit 6e76071113
2 changed files with 4 additions and 3 deletions
core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites

View File

@ -75,7 +75,6 @@ public class BlacksmithSprite extends MobSprite {
public void onComplete( Animation anim ) {
super.onComplete( anim );
//FIXME should figure out why onComplete is called constantly when an animation is paused
if (visible && emitter != null && anim == idle) {
emitter.burst( Speck.factory( Speck.FORGE ), 3 );
float volume = 0.2f / (Dungeon.level.distance( ch.pos, Dungeon.hero.pos ));

View File

@ -482,8 +482,10 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
@Override
public void update() {
if (paused && curAnim == die){
paused = false;
if (paused && !looping()){
Animation cur = curAnim;
curAnim = null;
listener.onComplete(cur);
}
super.update();