Fix premature end of animation playing backwards

This commit is contained in:
Pedro J. Estébanez 2020-10-10 21:37:28 +02:00
parent bf37ab52b3
commit 826af5b28a

View file

@ -762,12 +762,10 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, f
next_pos = len;
}
// fix delta
delta = next_pos - cd.pos;
bool backwards = signbit(delta); // Negative zero means playing backwards too
delta = next_pos - cd.pos; // Fix delta (after determination of backwards because negative zero is lost here)
if (&cd == &playback.current) {
bool backwards = delta < 0;
if (!backwards && cd.pos <= len && next_pos == len /*&& playback.blend.empty()*/) {
//playback finished
end_reached = true;