From 832eaae27b6933d256b4bb61a3224d4dc4bc0052 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 1 Feb 2016 22:57:08 +0100 Subject: [PATCH] Do not apply effects with CasterLinked flag when there is no valid caster --- apps/openmw/mwmechanics/spellcasting.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 6073076e0..4c5138835 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -378,6 +378,11 @@ namespace MWMechanics if (!checkEffectTarget(effectIt->mEffectID, target, castByPlayer)) continue; + // caster needs to be an actor for linked effects (e.g. Absorb) + if (magicEffect->mData.mFlags & ESM::MagicEffect::CasterLinked + && (caster.isEmpty() || !caster.getClass().isActor())) + continue; + // If player is healing someone, show the target's HP bar if (castByPlayer && target != caster && effectIt->mEffectID == ESM::MagicEffect::RestoreHealth