Core/Spells: Fix spellmod restore on failed cast for auras that have multiple mods for different spells (by lost-illusion)

This commit is contained in:
Shocker
2012-02-25 22:51:06 +02:00
parent c10e6708ed
commit f0d0d95cf9
@@ -20065,9 +20065,13 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
continue;
// check if mod affected this spell
// first, check if the mod aura applied at least one spellmod to this spell
Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura);
if (iterMod == spell->m_appliedMods.end())
continue;
// secondly, check if the current mod is one of the spellmods applied by the mod aura
if (!(mod->mask & spell->m_spellInfo->SpellFamilyFlags))
continue;
// remove from list
spell->m_appliedMods.erase(iterMod);