@ -447,9 +447,9 @@ namespace MWMechanics
if ( ! checkEffectTarget ( effectIt - > mEffectID , target , caster , castByPlayer ) )
if ( ! checkEffectTarget ( effectIt - > mEffectID , target , caster , castByPlayer ) )
continue ;
continue ;
// caster needs to be an actor that's not the target for linked effects (e.g. Absorb)
// caster needs to be an actor for linked effects (e.g. Absorb)
if ( magicEffect - > mData . mFlags & ESM : : MagicEffect : : CasterLinked
if ( magicEffect - > mData . mFlags & ESM : : MagicEffect : : CasterLinked
& & ( caster . isEmpty ( ) | | ! caster . getClass ( ) . isActor ( ) | | caster = = target ) )
& & ( caster . isEmpty ( ) | | ! caster . getClass ( ) . isActor ( ) ) )
continue ;
continue ;
// If player is healing someone, show the target's HP bar
// If player is healing someone, show the target's HP bar
@ -552,6 +552,20 @@ namespace MWMechanics
effect . mArg = MWMechanics : : EffectKey ( * effectIt ) . mArg ;
effect . mArg = MWMechanics : : EffectKey ( * effectIt ) . mArg ;
effect . mMagnitude = magnitude ;
effect . mMagnitude = magnitude ;
// Avoid applying absorb effects if the caster is the target
// We still need the spell to be added
if ( caster = = target )
{
for ( int i = 0 ; i < 5 ; + + i )
{
if ( effectIt - > mEffectID = = ESM : : MagicEffect : : AbsorbAttribute + i )
{
effect . mMagnitude = 0 ;
break ;
}
}
}
bool hasDuration = ! ( magicEffect - > mData . mFlags & ESM : : MagicEffect : : NoDuration ) ;
bool hasDuration = ! ( magicEffect - > mData . mFlags & ESM : : MagicEffect : : NoDuration ) ;
if ( hasDuration & & effectIt - > mDuration = = 0 )
if ( hasDuration & & effectIt - > mDuration = = 0 )
{
{
@ -614,6 +628,7 @@ namespace MWMechanics
else
else
caster . getClass ( ) . getCreatureStats ( caster ) . getActiveSpells ( ) . addSpell ( " " , true ,
caster . getClass ( ) . getCreatureStats ( caster ) . getActiveSpells ( ) . addSpell ( " " , true ,
absorbEffects , mSourceName , target . getClass ( ) . getCreatureStats ( target ) . getActorId ( ) ) ;
absorbEffects , mSourceName , target . getClass ( ) . getCreatureStats ( target ) . getActorId ( ) ) ;
break ;
}
}
}
}
}
}