Fix AStar crashing with large (>1e30) estimated values

Fixes #21601
This commit is contained in:
Bojidar Marinov 2019-01-30 20:22:08 +02:00
parent 35bb52011a
commit e34a4c63a7
No known key found for this signature in database
GPG key ID: 4B0FD31949AD430D

View file

@ -260,8 +260,8 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
} }
// Check open list // Check open list
SelfList<Point> *least_cost_point = NULL; SelfList<Point> *least_cost_point = open_list.first();
real_t least_cost = 1e30; real_t least_cost = Math_INF;
// TODO: Cache previous results // TODO: Cache previous results
for (SelfList<Point> *E = open_list.first(); E; E = E->next()) { for (SelfList<Point> *E = open_list.first(); E; E = E->next()) {