Move early out to better place

This commit is contained in:
Aussiemon 2025-07-06 11:41:02 -06:00 committed by Aussiemon
parent 09ed5bb234
commit 2db36c49b5
2 changed files with 7 additions and 8 deletions

View File

@ -124,6 +124,13 @@ namespace MWMechanics
if (actor == target) // This should never happen.
return true;
// No actions for totally static creatures
if (!actor.getClass().isMobile(actor))
{
storage.mFleeState = AiCombatStorage::FleeState_Idle;
return false;
}
if (!storage.isFleeing())
{
if (storage.mCurrentAction.get()) // need to wait to init action with its attack range
@ -231,10 +238,6 @@ namespace MWMechanics
storage.stopFleeing();
}
// No attack actions for totally static creatures
if (!actor.getClass().isMobile(actor))
return false;
bool isRangedCombat = false;
float& rangeAttack = storage.mAttackRange;

View File

@ -135,10 +135,6 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
MWWorld::MovementDirectionFlags supportedMovementDirections, float destTolerance, float endTolerance,
PathType pathType)
{
// No pathing for totally static creatures
if (!actor.getClass().isMobile(actor))
return false;
const Misc::TimerStatus timerStatus = mReaction.update(duration);
const osg::Vec3f position = actor.getRefData().getPosition().asVec3(); // position of the actor