Use pathgrid path when destination is closer to different graph component node

Partially revert d863267d5c to restore 0.46
behaviour for pathgrid based pathfinding.
This commit is contained in:
elsid 2021-08-18 19:52:08 +02:00
parent 6360bdc859
commit 9112c65afc
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -206,9 +206,6 @@ namespace MWMechanics
endPointInLocalCoords, endPointInLocalCoords,
startNode); startNode);
if (!endNode.second)
return;
// if it's shorter for actor to travel from start to end, than to travel from either // if it's shorter for actor to travel from start to end, than to travel from either
// start or end to nearest pathgrid point, just travel from start to end. // start or end to nearest pathgrid point, just travel from start to end.
float startToEndLength2 = (endPointInLocalCoords - startPointInLocalCoords).length2(); float startToEndLength2 = (endPointInLocalCoords - startPointInLocalCoords).length2();
@ -279,6 +276,7 @@ namespace MWMechanics
// unreachable pathgrid point. // unreachable pathgrid point.
// //
// The AI routines will have to deal with such situations. // The AI routines will have to deal with such situations.
if (endNode.second)
*out++ = endPoint; *out++ = endPoint;
} }