1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:53:50 +00:00

Remove useless else

This commit is contained in:
elsid 2018-08-18 18:28:12 +03:00
parent c9f3064cbd
commit 63b3a70ca8
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -178,21 +178,19 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
smoothTurn(actor, getXAngleToPoint(start, dest), 0);
return true;
}
else
if (mRotateOnTheRunChecks == 0
|| isReachableRotatingOnTheRun(actor, *mPathFinder.getPath().begin())) // to prevent circling around a path point
{
if (mRotateOnTheRunChecks == 0
|| isReachableRotatingOnTheRun(actor, *mPathFinder.getPath().begin())) // to prevent circling around a path point
{
actor.getClass().getMovementSettings(actor).mPosition[1] = 1; // move to the target
if (mRotateOnTheRunChecks > 0) mRotateOnTheRunChecks--;
}
mObstacleCheck.update(actor, duration);
// handle obstacles on the way
evadeObstacles(actor, pos);
actor.getClass().getMovementSettings(actor).mPosition[1] = 1; // move to the target
if (mRotateOnTheRunChecks > 0) mRotateOnTheRunChecks--;
}
mObstacleCheck.update(actor, duration);
// handle obstacles on the way
evadeObstacles(actor, pos);
// turn to next path point by X,Z axes
zTurn(actor, mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]));
smoothTurn(actor, mPathFinder.getXAngleToNext(pos.pos[0], pos.pos[1], pos.pos[2]), 0);