forked from teamnwah/openmw-tes3coop
Fix #1734: AI will stop combat if target disappear
This commit is contained in:
parent
406cf2b981
commit
bfa048e687
1 changed files with 5 additions and 0 deletions
|
@ -325,6 +325,11 @@ namespace MWMechanics
|
||||||
currentAction = prepareNextAction(actor, target);
|
currentAction = prepareNextAction(actor, target);
|
||||||
actionCooldown = currentAction->getActionCooldown();
|
actionCooldown = currentAction->getActionCooldown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop attacking if target is not seen
|
||||||
|
if (!MWBase::Environment::get().getMechanicsManager()->awarenessCheck(target, actor))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (currentAction.get())
|
if (currentAction.get())
|
||||||
currentAction->getCombatRange(rangeAttack, rangeFollow);
|
currentAction->getCombatRange(rangeAttack, rangeFollow);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue