Skip to content

Commit

Permalink
Merge pull request #1720 from jere8184/pathfinding_improvement
Browse files Browse the repository at this point in the history
pathfinding: small improvement
  • Loading branch information
heinezen authored Nov 30, 2024
2 parents faec07d + 7f7d5e2 commit 116a2c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libopenage/pathfinding/pathfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ const Pathfinder::portal_star_t Pathfinder::portal_a_star(const PathRequest &req
auto portal_pos = portal->get_exit_center(start_sector->get_id());
auto portal_abs_pos = sector_pos + portal_pos;
auto heuristic_cost = Pathfinder::heuristic_cost(portal_abs_pos, request.target);

portal_node->current_cost = 0;
portal_node->current_cost = Pathfinder::heuristic_cost(portal_abs_pos, request.start);
portal_node->heuristic_cost = heuristic_cost;
portal_node->future_cost = portal_node->current_cost + heuristic_cost;

Expand Down

0 comments on commit 116a2c0

Please sign in to comment.