1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-04 02:43:10 +00:00

Found better place for early return

This commit is contained in:
Aussiemon 2025-04-15 18:38:53 -06:00 committed by Aussiemon
parent 23dc226dff
commit 3df695df4a

View file

@ -231,6 +231,10 @@ 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;
@ -245,9 +249,7 @@ namespace MWMechanics
float distToTarget = getDistanceToBounds(actor, target);
// Must be attacking, within range, have line of sight, and not be immobile
storage.mReadyToAttack = (currentAction->isAttackingOrSpell() && distToTarget <= rangeAttack && storage.mLOS
&& actor.getClass().isMobile(actor));
storage.mReadyToAttack = (currentAction->isAttackingOrSpell() && distToTarget <= rangeAttack && storage.mLOS);
if (isRangedCombat)
{