diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2019-01-30 20:22:08 +0200 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2019-01-30 20:22:08 +0200 |
commit | e34a4c63a70ac69703523f9d0b835929b3ba4a0d (patch) | |
tree | abba894099e2c498a476cc82b2dc03b257336e28 | |
parent | 35bb52011a4cbcd8ca3779ab1761244f06a33127 (diff) |
Fix AStar crashing with large (>1e30) estimated values
Fixes #21601
-rw-r--r-- | core/math/a_star.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index a0556ae839..b885a06834 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -260,8 +260,8 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { } // Check open list - SelfList<Point> *least_cost_point = NULL; - real_t least_cost = 1e30; + SelfList<Point> *least_cost_point = open_list.first(); + real_t least_cost = Math_INF; // TODO: Cache previous results for (SelfList<Point> *E = open_list.first(); E; E = E->next()) { |