From 1c75603ff56a24b38b3fda1482d70d1d905ef8df Mon Sep 17 00:00:00 2001 From: zer0problem Date: Fri, 23 Nov 2018 16:53:25 +0100 Subject: [PATCH] Fixed signal animation_finished The signal animation_finished is now fired after all values have been changed so changes to the animation can be done without animation_finished without generating unexpected behavior. --- scene/2d/animated_sprite.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index b31bb39c0db..b11c2c28868 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -398,11 +398,11 @@ void AnimatedSprite::_notification(int p_what) { emit_signal(SceneStringNames::get_singleton()->animation_finished); frame = 0; } else { - if (!is_over) { - emit_signal(SceneStringNames::get_singleton()->animation_finished); - is_over = true; - } frame = fc - 1; + if (!is_over) { + is_over = true; + emit_signal(SceneStringNames::get_singleton()->animation_finished); + } } } else { frame++;