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.
This commit is contained in:
zer0problem 2018-11-23 16:53:25 +01:00 committed by GitHub
parent c48027af92
commit 1c75603ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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++;