|
|
|
@ -590,7 +590,9 @@ namespace MWMechanics
|
|
|
|
|
|
|
|
|
|
if (!actorState.isTurningToPlayer())
|
|
|
|
|
{
|
|
|
|
|
float angle = std::atan2(dir.x(), dir.y());
|
|
|
|
|
float from = dir.x();
|
|
|
|
|
float to = dir.y();
|
|
|
|
|
float angle = std::atan2(from, to);
|
|
|
|
|
actorState.setAngleToPlayer(angle);
|
|
|
|
|
float deltaAngle = Misc::normalizeAngle(angle - actor.getRefData().getPosition().rot[2]);
|
|
|
|
|
if (!mSmoothMovement || std::abs(deltaAngle) > osg::DegreesToRadians(60.f))
|
|
|
|
@ -1723,7 +1725,7 @@ namespace MWMechanics
|
|
|
|
|
shouldAvoidCollision = true;
|
|
|
|
|
else if (package->getTypeId() == AiPackageTypeId::Wander && giveWayWhenIdle)
|
|
|
|
|
{
|
|
|
|
|
if (!dynamic_cast<const AiWander*>(package.get())->isStationary())
|
|
|
|
|
if (!static_cast<const AiWander*>(package.get())->isStationary())
|
|
|
|
|
shouldAvoidCollision = true;
|
|
|
|
|
}
|
|
|
|
|
else if (package->getTypeId() == AiPackageTypeId::Combat || package->getTypeId() == AiPackageTypeId::Pursue)
|
|
|
|
|