|
|
|
@ -314,14 +314,17 @@ namespace MWMechanics
|
|
|
|
|
{
|
|
|
|
|
const ESM::Pathgrid::Point oldStart(*getPath().begin());
|
|
|
|
|
buildPath(startPoint, endPoint, cell, pathgridGraph);
|
|
|
|
|
// if 2nd waypoint of new path == 1st waypoint of old,
|
|
|
|
|
// delete 1st waypoint of new path.
|
|
|
|
|
std::list<ESM::Pathgrid::Point>::iterator iter = ++mPath.begin();
|
|
|
|
|
if (iter->mX == oldStart.mX
|
|
|
|
|
&& iter->mY == oldStart.mY
|
|
|
|
|
&& iter->mZ == oldStart.mZ)
|
|
|
|
|
if (mPath.size() >= 2)
|
|
|
|
|
{
|
|
|
|
|
mPath.pop_front();
|
|
|
|
|
// if 2nd waypoint of new path == 1st waypoint of old,
|
|
|
|
|
// delete 1st waypoint of new path.
|
|
|
|
|
std::list<ESM::Pathgrid::Point>::iterator iter = ++mPath.begin();
|
|
|
|
|
if (iter->mX == oldStart.mX
|
|
|
|
|
&& iter->mY == oldStart.mY
|
|
|
|
|
&& iter->mZ == oldStart.mZ)
|
|
|
|
|
{
|
|
|
|
|
mPath.pop_front();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|