mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Pathfinding bugfix.
Observed at Ebonheart (coe 1, -13). Especially at the western tower. Guards try to walk though tower door. Cause: buildPath() adds destination (even when unreachable) when only using single node from pathgrid.
This commit is contained in:
parent
f2c9b9351f
commit
39c2ba8efe
@ -225,20 +225,17 @@ namespace MWMechanics
|
||||
ESM::Pathgrid::Point temp(mPathgrid->mPoints[startNode]);
|
||||
converter.ToWorld(temp);
|
||||
mPath.push_back(temp);
|
||||
|
||||
mPath.push_back(endPoint);
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
mPath = mCell->aStarSearch(startNode, endNode.first);
|
||||
if (mPath.empty())
|
||||
return;
|
||||
|
||||
// convert supplied path to world co-ordinates
|
||||
for (std::list<ESM::Pathgrid::Point>::iterator iter(mPath.begin()); iter != mPath.end(); ++iter)
|
||||
{
|
||||
converter.ToWorld(*iter);
|
||||
}
|
||||
}
|
||||
|
||||
// If endNode found is NOT the closest PathGrid point to the endPoint,
|
||||
// assume endPoint is not reachable from endNode. In which case,
|
||||
@ -254,8 +251,6 @@ namespace MWMechanics
|
||||
// The AI routines will have to deal with such situations.
|
||||
if(endNode.second)
|
||||
mPath.push_back(endPoint);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
float PathFinder::getZAngleToNext(float x, float y) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user