1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-26 06:40:22 +00:00

Better checks for enemy incapacitation

This commit is contained in:
Capostrophic 2018-09-01 01:44:29 +03:00
parent 2965373ed6
commit ceb6121b33

View File

@ -240,7 +240,7 @@ namespace MWMechanics
const CreatureStats& stats = enemy.getClass().getCreatureStats(enemy); const CreatureStats& stats = enemy.getClass().getCreatureStats(enemy);
// Enemy can't attack // Enemy can't attack
if (stats.getMagicEffects().get(ESM::MagicEffect::Paralyze).getMagnitude() > 0) if (stats.isParalyzed() || stats.getKnockedDown())
return 0.f; return 0.f;
// Enemy doesn't attack // Enemy doesn't attack
@ -261,7 +261,7 @@ namespace MWMechanics
if (stats.getMagicEffects().get(ESM::MagicEffect::Silence).getMagnitude() > 0) if (stats.getMagicEffects().get(ESM::MagicEffect::Silence).getMagnitude() > 0)
return 0.f; return 0.f;
if (stats.getMagicEffects().get(ESM::MagicEffect::Paralyze).getMagnitude() > 0) if (stats.isParalyzed() || stats.getKnockedDown())
return 0.f; return 0.f;
// Enemy doesn't cast spells // Enemy doesn't cast spells
@ -279,7 +279,7 @@ namespace MWMechanics
const CreatureStats& stats = enemy.getClass().getCreatureStats(enemy); const CreatureStats& stats = enemy.getClass().getCreatureStats(enemy);
// Enemy can't cast spells // Enemy can't cast spells
if (stats.getMagicEffects().get(ESM::MagicEffect::Paralyze).getMagnitude() > 0) if (stats.isParalyzed() || stats.getKnockedDown())
return 0.f; return 0.f;
// Enemy doesn't cast spells // Enemy doesn't cast spells