diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index a0556ae839e..b885a06834c 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 *least_cost_point = NULL; - real_t least_cost = 1e30; + SelfList *least_cost_point = open_list.first(); + real_t least_cost = Math_INF; // TODO: Cache previous results for (SelfList *E = open_list.first(); E; E = E->next()) {