summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2018-05-13 23:26:45 -0300
committerMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2018-05-14 02:14:56 -0300
commit7f72d6476b7bf5a248685e91a994ac4d73e50ff6 (patch)
treefd6136d186eb11a8421835c27810945974d7c964 /scene/animation
parent0db3d1d2a754aa122bcbb6ed74cf6f10ba3fc859 (diff)
Fixed some warnings found with Cppcheck.
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_player.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index c0d1e62e07..a0e0137863 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -507,7 +507,6 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, float p_blend) {
float delta = p_delta * speed_scale * cd.speed_scale;
- bool backwards = delta < 0;
float next_pos = cd.pos + delta;
float len = cd.from->animation->get_length();
@@ -525,6 +524,8 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, f
if (&cd == &playback.current) {
+ bool backwards = delta < 0;
+
if (!backwards && cd.pos <= len && next_pos == len /*&& playback.blend.empty()*/) {
//playback finished
end_reached = true;