summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorDualMatrix <piet.goris@gmail.com>2018-11-10 14:21:40 +0100
committerDualMatrix <piet.goris@gmail.com>2018-11-10 23:09:02 +0100
commitb4315abb715a097b453f7a8a528e7aef8c5815e3 (patch)
treebfef25ccd6fea1bd700e0532785fd084d46aeaaa /scene
parent531dc2f435c1d64a2e3ef0710cc05a7c13969587 (diff)
Fixed floating point issue in find() of animation.
Fixes #23504
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/animation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 5c01cadcd5..803c85ef34 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -1469,7 +1469,7 @@ int Animation::_find(const Vector<K> &p_keys, float p_time) const {
middle = (low + high) / 2;
- if (p_time == keys[middle].time) { //match
+ if (Math::abs(p_time - keys[middle].time) < CMP_EPSILON) { //match
return middle;
} else if (p_time < keys[middle].time)
high = middle - 1; //search low end of array