mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 02:06:43 +00:00
Make path point tolerance depending on actor half extents
This commit is contained in:
parent
1e4bbe8997
commit
8fd6b37e34
1 changed files with 3 additions and 1 deletions
|
@ -167,7 +167,9 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
|||
mTimer = 0;
|
||||
}
|
||||
|
||||
const float pointTolerance = std::max(MIN_TOLERANCE, std::min(actor.getClass().getSpeed(actor), DEFAULT_TOLERANCE));
|
||||
const float actorTolerance = 2 * actor.getClass().getSpeed(actor) * duration
|
||||
+ 1.2 * std::max(halfExtents.x(), halfExtents.y());
|
||||
const float pointTolerance = std::max(MIN_TOLERANCE, actorTolerance);
|
||||
|
||||
mPathFinder.update(position, pointTolerance, DEFAULT_TOLERANCE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue