Merge pull request #85253 from sandygk/fix-reachable-polygon-closest-to-end-point
[Navigation] Do not use travel cost for minimum when re-selecting end point
This commit is contained in:
commit
d4806d2d84
1 changed files with 1 additions and 1 deletions
|
@ -372,7 +372,7 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p
|
||||||
|
|
||||||
// Stores the further reachable end polygon, in case our goal is not reachable.
|
// Stores the further reachable end polygon, in case our goal is not reachable.
|
||||||
if (is_reachable) {
|
if (is_reachable) {
|
||||||
real_t d = navigation_polys[least_cost_id].entry.distance_to(p_destination) * navigation_polys[least_cost_id].poly->owner->get_travel_cost();
|
real_t d = navigation_polys[least_cost_id].entry.distance_to(p_destination);
|
||||||
if (reachable_d > d) {
|
if (reachable_d > d) {
|
||||||
reachable_d = d;
|
reachable_d = d;
|
||||||
reachable_end = navigation_polys[least_cost_id].poly;
|
reachable_end = navigation_polys[least_cost_id].poly;
|
||||||
|
|
Loading…
Reference in a new issue