mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Use pathgrid path when destination is closer to different graph component node
Partially revert d863267d5cb5f4062937f86c37af3b0c8f9479cf to restore 0.46 behaviour for pathgrid based pathfinding.
This commit is contained in:
parent
6360bdc859
commit
9112c65afc
@ -206,9 +206,6 @@ namespace MWMechanics
|
||||
endPointInLocalCoords,
|
||||
startNode);
|
||||
|
||||
if (!endNode.second)
|
||||
return;
|
||||
|
||||
// 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.
|
||||
float startToEndLength2 = (endPointInLocalCoords - startPointInLocalCoords).length2();
|
||||
@ -279,7 +276,8 @@ namespace MWMechanics
|
||||
// unreachable pathgrid point.
|
||||
//
|
||||
// The AI routines will have to deal with such situations.
|
||||
*out++ = endPoint;
|
||||
if (endNode.second)
|
||||
*out++ = endPoint;
|
||||
}
|
||||
|
||||
float PathFinder::getZAngleToNext(float x, float y) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user