Remove sneaking effect on combat AI (Fixes #2237)

moveref
scrawl 10 years ago
parent 1bd3ab8a2d
commit a58bc9f2f7

@ -300,6 +300,14 @@ namespace MWMechanics
//Update with period = tReaction
// Stop attacking if target is not seen
if (target.getClass().getCreatureStats(target).getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude() > 0
|| target.getClass().getCreatureStats(target).getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude() > 75)
{
movement.mPosition[1] = movement.mPosition[0] = 0;
return false; // TODO: run away instead of doing nothing
}
timerReact = 0;
const MWWorld::CellStore*& currentCell = storage.mCell;
bool cellChange = currentCell && (actor.getCell() != currentCell);
@ -326,10 +334,6 @@ namespace MWMechanics
actionCooldown = currentAction->getActionCooldown();
}
// Stop attacking if target is not seen
if (!MWBase::Environment::get().getMechanicsManager()->awarenessCheck(target, actor))
return true;
if (currentAction.get())
currentAction->getCombatRange(rangeAttack, rangeFollow);

Loading…
Cancel
Save