forked from teamnwah/openmw-tes3coop
Made PathFinder::buildPath() private.
Now all paths are built by calling PathFinder::buildSyncedPath(). Also removed useless comment.
This commit is contained in:
parent
2385938485
commit
164994f3d3
2 changed files with 4 additions and 12 deletions
|
@ -410,7 +410,7 @@ namespace MWMechanics
|
||||||
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
|
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
|
||||||
|
|
||||||
// don't take shortcuts for wandering
|
// don't take shortcuts for wandering
|
||||||
storage.mPathFinder.buildPath(start, dest, actor.getCell(), false);
|
storage.mPathFinder.buildSyncedPath(start, dest, actor.getCell(), false);
|
||||||
|
|
||||||
if(storage.mPathFinder.isPathConstructed())
|
if(storage.mPathFinder.isPathConstructed())
|
||||||
{
|
{
|
||||||
|
@ -510,17 +510,10 @@ namespace MWMechanics
|
||||||
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
|
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
|
||||||
|
|
||||||
// don't take shortcuts for wandering
|
// don't take shortcuts for wandering
|
||||||
storage.mPathFinder.buildPath(start, dest, actor.getCell(), false);
|
storage.mPathFinder.buildSyncedPath(start, dest, actor.getCell(), false);
|
||||||
|
|
||||||
if(storage.mPathFinder.isPathConstructed())
|
if(storage.mPathFinder.isPathConstructed())
|
||||||
{
|
{
|
||||||
// buildPath inserts dest in case it is not a pathgraph point
|
|
||||||
// index which is a duplicate for AiWander. However below code
|
|
||||||
// does not work since getPath() returns a copy of path not a
|
|
||||||
// reference
|
|
||||||
//if(storage.mPathFinder.getPathSize() > 1)
|
|
||||||
//storage.mPathFinder.getPath().pop_back();
|
|
||||||
|
|
||||||
// Remove this node as an option and add back the previously used node (stops NPC from picking the same node):
|
// Remove this node as an option and add back the previously used node (stops NPC from picking the same node):
|
||||||
ESM::Pathgrid::Point temp = mAllowedNodes[randNode];
|
ESM::Pathgrid::Point temp = mAllowedNodes[randNode];
|
||||||
mAllowedNodes.erase(mAllowedNodes.begin() + randNode);
|
mAllowedNodes.erase(mAllowedNodes.begin() + randNode);
|
||||||
|
|
|
@ -35,9 +35,6 @@ namespace MWMechanics
|
||||||
|
|
||||||
void clearPath();
|
void clearPath();
|
||||||
|
|
||||||
void buildPath(const ESM::Pathgrid::Point &startPoint, const ESM::Pathgrid::Point &endPoint,
|
|
||||||
const MWWorld::CellStore* cell, bool allowShortcuts = true);
|
|
||||||
|
|
||||||
bool checkPathCompleted(float x, float y, float tolerance=32.f);
|
bool checkPathCompleted(float x, float y, float tolerance=32.f);
|
||||||
///< \Returns true if we are within \a tolerance units of the last path point.
|
///< \Returns true if we are within \a tolerance units of the last path point.
|
||||||
|
|
||||||
|
@ -92,6 +89,8 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void buildPath(const ESM::Pathgrid::Point &startPoint, const ESM::Pathgrid::Point &endPoint,
|
||||||
|
const MWWorld::CellStore* cell, bool allowShortcuts = true);
|
||||||
|
|
||||||
std::list<ESM::Pathgrid::Point> mPath;
|
std::list<ESM::Pathgrid::Point> mPath;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue