From 72c3ee0a3dc352208f20344ea9028b80fc6a542b Mon Sep 17 00:00:00 2001 From: Allofich Date: Sun, 12 Feb 2017 23:14:09 +0900 Subject: [PATCH] Make AI not go hostile when absorbing/reflecting --- apps/openmw/mwmechanics/spellcasting.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 5dd47d230..230d01e78 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -413,10 +413,6 @@ namespace MWMechanics float magnitudeMult = 1; if (magicEffect->mData.mFlags & ESM::MagicEffect::Harmful && target.getClass().isActor()) { - // Notify the target actor they've been hit - if (target != caster && !caster.isEmpty()) - target.getClass().onHit(target, 0.0f, true, MWWorld::Ptr(), caster, osg::Vec3f(), true); - if (absorbed) continue; @@ -449,6 +445,10 @@ namespace MWMechanics // If player is attempting to cast a harmful spell, show the target's HP bar if (castByPlayer && target != caster) MWBase::Environment::get().getWindowManager()->setEnemy(target); + + // Notify the target actor they've been hit + if (target != caster && !caster.isEmpty()) + target.getClass().onHit(target, 0.0f, true, MWWorld::Ptr(), caster, osg::Vec3f(), true); } if (magnitudeMult > 0 && !absorbed)