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:
@@ -20065,9 +20065,13 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// check if mod affected this spell
|
// 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);
|
Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura);
|
||||||
if (iterMod == spell->m_appliedMods.end())
|
if (iterMod == spell->m_appliedMods.end())
|
||||||
continue;
|
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
|
// remove from list
|
||||||
spell->m_appliedMods.erase(iterMod);
|
spell->m_appliedMods.erase(iterMod);
|
||||||
|
|||||||
Reference in New Issue
Block a user