summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-08-07 12:54:30 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-08-07 12:54:30 +0200
commite0b5b218638df5b7b2998233182a7d8a1118e717 (patch)
tree0de2f04fbb41472d3bd9b43141f26193cb062be9 /scene/animation
parent045ab51ae50139e645958149c6d6d354026ccdd4 (diff)
Add some code changes/fixes proposed by Coverity and Clang Tidy
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_blend_space_1d.cpp2
-rw-r--r--scene/animation/animation_blend_space_2d.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp
index dded44b990..416a291da1 100644
--- a/scene/animation/animation_blend_space_1d.cpp
+++ b/scene/animation/animation_blend_space_1d.cpp
@@ -266,7 +266,7 @@ float AnimationNodeBlendSpace1D::process(float p_time, bool p_seek) {
// fill in weights
- if (point_lower == -1) {
+ if (point_lower == -1 && point_higher != -1) {
// we are on the left side, no other point to the left
// we just play the next point.
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index 95d4644004..75031f0149 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -527,7 +527,7 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
}
}
- if (new_closest != closest) {
+ if (new_closest != closest && new_closest != -1) {
float from = 0;
if (blend_mode == BLEND_MODE_DISCRETE_CARRY && closest != -1) {