diff options
author | DualMatrix <piet.goris@gmail.com> | 2018-11-10 14:21:40 +0100 |
---|---|---|
committer | DualMatrix <piet.goris@gmail.com> | 2018-11-10 23:09:02 +0100 |
commit | b4315abb715a097b453f7a8a528e7aef8c5815e3 (patch) | |
tree | bfef25ccd6fea1bd700e0532785fd084d46aeaaa | |
parent | 531dc2f435c1d64a2e3ef0710cc05a7c13969587 (diff) |
Fixed floating point issue in find() of animation.
Fixes #23504
-rw-r--r-- | scene/resources/animation.cpp | 2 |
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 |