mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Fix self-defense for creatures when attacked with a spell
This commit is contained in:
parent
3cdbcf3c28
commit
6c7b3074f5
@ -408,9 +408,9 @@ namespace MWMechanics
|
|||||||
target.getClass().getCreatureStats(target).getActiveSpells().addSpell(mId, mStack, appliedLastingEffects,
|
target.getClass().getCreatureStats(target).getActiveSpells().addSpell(mId, mStack, appliedLastingEffects,
|
||||||
mSourceName, caster.getRefData().getHandle());
|
mSourceName, caster.getRefData().getHandle());
|
||||||
|
|
||||||
if (anyHarmfulEffect && target.getClass().isActor() && target != caster
|
// Notify the target actor they've been hit
|
||||||
&& target.getClass().getCreatureStats(target).getAiSetting(MWMechanics::CreatureStats::AI_Fight).getModified() <= 30)
|
if (anyHarmfulEffect && target.getClass().isActor() && target != caster)
|
||||||
MWBase::Environment::get().getMechanicsManager()->commitCrime(caster, target, MWBase::MechanicsManager::OT_Assault);
|
target.getClass().onHit(target, 0.f, true, MWWorld::Ptr(), caster, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CastSpell::applyInstantEffect(const MWWorld::Ptr &target, const MWWorld::Ptr &caster, const MWMechanics::EffectKey& effect, float magnitude)
|
void CastSpell::applyInstantEffect(const MWWorld::Ptr &target, const MWWorld::Ptr &caster, const MWMechanics::EffectKey& effect, float magnitude)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user