mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 21:41:04 +00:00
Merge branch 'stanky_fetcher' into 'master'
Consider a path completed if it was non-empty Closes #5773 See merge request OpenMW/openmw!508
This commit is contained in:
commit
cbce3ebb79
@ -158,8 +158,10 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
|||||||
zTurn(actor, getZAngleToPoint(position, dest));
|
zTurn(actor, getZAngleToPoint(position, dest));
|
||||||
smoothTurn(actor, getXAngleToPoint(position, dest), 0);
|
smoothTurn(actor, getXAngleToPoint(position, dest), 0);
|
||||||
world->removeActorPath(actor);
|
world->removeActorPath(actor);
|
||||||
return isDestReached;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (mPathFinder.getPath().empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
world->updateActorPath(actor, mPathFinder.getPath(), halfExtents, position, dest);
|
world->updateActorPath(actor, mPathFinder.getPath(), halfExtents, position, dest);
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ namespace MWMechanics
|
|||||||
|
|
||||||
buildPathByPathgridImpl(startPoint, endPoint, pathgridGraph, std::back_inserter(mPath));
|
buildPathByPathgridImpl(startPoint, endPoint, pathgridGraph, std::back_inserter(mPath));
|
||||||
|
|
||||||
mConstructed = true;
|
mConstructed = !mPath.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathFinder::buildPathByNavMesh(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint,
|
void PathFinder::buildPathByNavMesh(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint,
|
||||||
@ -341,7 +341,7 @@ namespace MWMechanics
|
|||||||
if (!buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags, areaCosts, std::back_inserter(mPath)))
|
if (!buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags, areaCosts, std::back_inserter(mPath)))
|
||||||
mPath.push_back(endPoint);
|
mPath.push_back(endPoint);
|
||||||
|
|
||||||
mConstructed = true;
|
mConstructed = !mPath.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathFinder::buildPath(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint, const osg::Vec3f& endPoint,
|
void PathFinder::buildPath(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint, const osg::Vec3f& endPoint,
|
||||||
@ -366,7 +366,7 @@ namespace MWMechanics
|
|||||||
if (!hasNavMesh && mPath.empty())
|
if (!hasNavMesh && mPath.empty())
|
||||||
mPath.push_back(endPoint);
|
mPath.push_back(endPoint);
|
||||||
|
|
||||||
mConstructed = true;
|
mConstructed = !mPath.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PathFinder::buildPathByNavigatorImpl(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint,
|
bool PathFinder::buildPathByNavigatorImpl(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user