mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-26 14:36:40 -04:00
Remove useless else
This commit is contained in:
parent
c9f3064cbd
commit
63b3a70ca8
@ -178,21 +178,19 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
|||||||
smoothTurn(actor, getXAngleToPoint(start, dest), 0);
|
smoothTurn(actor, getXAngleToPoint(start, dest), 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (mRotateOnTheRunChecks == 0
|
||||||
|
|| isReachableRotatingOnTheRun(actor, *mPathFinder.getPath().begin())) // to prevent circling around a path point
|
||||||
{
|
{
|
||||||
if (mRotateOnTheRunChecks == 0
|
actor.getClass().getMovementSettings(actor).mPosition[1] = 1; // move to the target
|
||||||
|| isReachableRotatingOnTheRun(actor, *mPathFinder.getPath().begin())) // to prevent circling around a path point
|
if (mRotateOnTheRunChecks > 0) mRotateOnTheRunChecks--;
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mObstacleCheck.update(actor, duration);
|
||||||
|
|
||||||
|
// handle obstacles on the way
|
||||||
|
evadeObstacles(actor, pos);
|
||||||
|
|
||||||
// turn to next path point by X,Z axes
|
// turn to next path point by X,Z axes
|
||||||
zTurn(actor, mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]));
|
zTurn(actor, mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]));
|
||||||
smoothTurn(actor, mPathFinder.getXAngleToNext(pos.pos[0], pos.pos[1], pos.pos[2]), 0);
|
smoothTurn(actor, mPathFinder.getXAngleToNext(pos.pos[0], pos.pos[1], pos.pos[2]), 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user