mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 12:54:00 +00:00
Increase the distance for reaching a path node
This commit is contained in:
parent
f9dbce685a
commit
9499ac4fd5
@ -238,15 +238,7 @@ namespace MWMechanics
|
||||
world->rotateObject(actor, 0, 0, zAngle, false);
|
||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
||||
|
||||
// Unclog path nodes by allowing the NPC to be a small distance away from the center. This way two NPCs can be
|
||||
// at the same path node at the same time and both will complete instead of endlessly walking into eachother:
|
||||
Ogre::Vector3 destNodePos(mCurrentNode.mX, mCurrentNode.mY, mCurrentNode.mZ);
|
||||
Ogre::Vector3 actorPos(actor.getRefData().getPosition().pos);
|
||||
actorPos[0] = actorPos[0] - mXCell;
|
||||
actorPos[1] = actorPos[1] - mYCell;
|
||||
float distance = actorPos.squaredDistance(destNodePos);
|
||||
|
||||
if(distance < 32*32 || mPathFinder.checkPathCompleted(pos.pos[0], pos.pos[1], pos.pos[2]))
|
||||
if(mPathFinder.checkPathCompleted(pos.pos[0], pos.pos[1], pos.pos[2]))
|
||||
{
|
||||
stopWalking(actor);
|
||||
mMoveNow = false;
|
||||
|
@ -205,7 +205,7 @@ namespace MWMechanics
|
||||
return true;
|
||||
|
||||
ESM::Pathgrid::Point nextPoint = *mPath.begin();
|
||||
if(distanceZCorrected(nextPoint, x, y, z) < 40)
|
||||
if(distanceZCorrected(nextPoint, x, y, z) < 64)
|
||||
{
|
||||
mPath.pop_front();
|
||||
if(mPath.empty())
|
||||
|
Loading…
Reference in New Issue
Block a user