Merge pull request #42703 from RandomShaper/fix_anim_backwards
Fix premature end of animation playing backwards
This commit is contained in:
commit
223e361c4e
1 changed files with 2 additions and 4 deletions
|
@ -762,12 +762,10 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, f
|
||||||
next_pos = len;
|
next_pos = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix delta
|
bool backwards = signbit(delta); // Negative zero means playing backwards too
|
||||||
delta = next_pos - cd.pos;
|
delta = next_pos - cd.pos; // Fix delta (after determination of backwards because negative zero is lost here)
|
||||||
|
|
||||||
if (&cd == &playback.current) {
|
if (&cd == &playback.current) {
|
||||||
bool backwards = delta < 0;
|
|
||||||
|
|
||||||
if (!backwards && cd.pos <= len && next_pos == len /*&& playback.blend.empty()*/) {
|
if (!backwards && cd.pos <= len && next_pos == len /*&& playback.blend.empty()*/) {
|
||||||
//playback finished
|
//playback finished
|
||||||
end_reached = true;
|
end_reached = true;
|
||||||
|
|
Loading…
Reference in a new issue