Core/Spells: Remove spellmods from SpellMod owner instead of caster (needed so pet casts properly remove aura charges)

This commit is contained in:
ariel-
2016-09-01 01:09:23 -03:00
committed by Aokromes
parent 87bcba9a1f
commit fe32fffa56

View File

@@ -3672,15 +3672,18 @@ void Spell::finish(bool ok)
{
if (!m_triggeredByAuraSpell)
m_caster->ToPlayer()->UpdatePotionCooldown(this);
}
if (Player* modOwner = m_caster->GetSpellModOwner())
{
// triggered spell pointer can be not set in some cases
// this is needed for proper apply of triggered spell mods
m_caster->ToPlayer()->SetSpellModTakingSpell(this, true);
modOwner->SetSpellModTakingSpell(this, true);
// Take mods after trigger spell (needed for 14177 to affect 48664)
// mods are taken only on succesfull cast and independantly from targets of the spell
m_caster->ToPlayer()->RemoveSpellMods(this);
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
modOwner->RemoveSpellMods(this);
modOwner->SetSpellModTakingSpell(this, false);
}
// Stop Attack for some spells