mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Remove sneaking effect on combat AI (Fixes #2237)
This commit is contained in:
parent
1bd3ab8a2d
commit
a58bc9f2f7
1 changed files with 8 additions and 4 deletions
|
@ -300,6 +300,14 @@ namespace MWMechanics
|
||||||
|
|
||||||
//Update with period = tReaction
|
//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;
|
timerReact = 0;
|
||||||
const MWWorld::CellStore*& currentCell = storage.mCell;
|
const MWWorld::CellStore*& currentCell = storage.mCell;
|
||||||
bool cellChange = currentCell && (actor.getCell() != currentCell);
|
bool cellChange = currentCell && (actor.getCell() != currentCell);
|
||||||
|
@ -326,10 +334,6 @@ namespace MWMechanics
|
||||||
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