1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Merge pull request #38107 from EspeuteClement/master

This commit is contained in:
Rémi Verschelde
2021-09-15 11:33:34 +02:00
committed by GitHub

View File

@@ -737,7 +737,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double
if (anim->has_loop()) { if (anim->has_loop()) {
at_anim_pos = Math::fposmod(p_time - pos, (double)anim->get_length()); //seek to loop at_anim_pos = Math::fposmod(p_time - pos, (double)anim->get_length()); //seek to loop
} else { } else {
at_anim_pos = MAX((double)anim->get_length(), p_time - pos); //seek to end at_anim_pos = MIN((double)anim->get_length(), p_time - pos); //seek to end
} }
if (player->is_playing() || p_seeked) { if (player->is_playing() || p_seeked) {
@@ -765,6 +765,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double
} }
} else { } else {
player->play(anim_name); player->play(anim_name);
player->seek(0.0, true);
nc->animation_playing = true; nc->animation_playing = true;
playing_caches.insert(nc); playing_caches.insert(nc);
} }