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:
parent
23dc226dff
commit
3df695df4a
1 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue