From b4315abb715a097b453f7a8a528e7aef8c5815e3 Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Sat, 10 Nov 2018 14:21:40 +0100 Subject: Fixed floating point issue in find() of animation. Fixes #23504 --- scene/resources/animation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 &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 -- cgit v1.2.3