From a0a9363b7a2d4bd70477857beaed96e9c20e9cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sat, 14 Oct 2017 22:21:20 +0200 Subject: [PATCH] Fix animation not stopping after seeking to the end Fixes #10228. (cherry picked from commit 2d2467c0ff8ba05f492cefef3adbcd5513bbd8dd) --- scene/animation/animation_player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 4038aaff0e3..9cf9e35441a 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -525,12 +525,12 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, f if (&cd == &playback.current) { - if (!backwards && cd.pos < len && next_pos == len /*&& playback.blend.empty()*/) { + if (!backwards && cd.pos <= len && next_pos == len /*&& playback.blend.empty()*/) { //playback finished end_notify = true; } - if (backwards && cd.pos > 0 && next_pos == 0 /*&& playback.blend.empty()*/) { + if (backwards && cd.pos >= 0 && next_pos == 0 /*&& playback.blend.empty()*/) { //playback finished end_notify = true; }