Merge pull request #25382 from groud/change_frame_before_signal

Change the frame number before triggering the animation_finished signal
This commit is contained in:
Rémi Verschelde 2019-01-27 18:11:29 +01:00 committed by GitHub
commit eb1e3ee232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -395,8 +395,8 @@ void AnimatedSprite::_notification(int p_what) {
int fc = frames->get_frame_count(animation);
if (frame >= fc - 1) {
if (frames->get_animation_loop(animation)) {
emit_signal(SceneStringNames::get_singleton()->animation_finished);
frame = 0;
emit_signal(SceneStringNames::get_singleton()->animation_finished);
} else {
frame = fc - 1;
if (!is_over) {