Skip to content

Commit 116a2c0

Browse files
authored
Merge pull request SFTtech#1720 from jere8184/pathfinding_improvement
pathfinding: small improvement
2 parents faec07d + 7f7d5e2 commit 116a2c0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libopenage/pathfinding/pathfinder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ const Pathfinder::portal_star_t Pathfinder::portal_a_star(const PathRequest &req
231231
auto portal_pos = portal->get_exit_center(start_sector->get_id());
232232
auto portal_abs_pos = sector_pos + portal_pos;
233233
auto heuristic_cost = Pathfinder::heuristic_cost(portal_abs_pos, request.target);
234-
235-
portal_node->current_cost = 0;
234+
portal_node->current_cost = Pathfinder::heuristic_cost(portal_abs_pos, request.start);
236235
portal_node->heuristic_cost = heuristic_cost;
237236
portal_node->future_cost = portal_node->current_cost + heuristic_cost;
238237

0 commit comments

Comments
 (0)