Core/Auras: Fix refresh of auras with spellmodifiers applied to currently cast spell.

This commit is contained in:
QAston
2011-06-21 19:59:17 +02:00
parent 65233f8e66
commit c4818f1892
5 changed files with 25 additions and 4 deletions
+11 -1
View File
@@ -19609,7 +19609,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply)
}
// Restore spellmods in case of failed cast
void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId)
void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
{
if (!spell || spell->m_appliedMods.empty())
return;
@@ -19628,6 +19628,9 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId)
if (ownerAuraId && (ownerAuraId != mod->ownerAura->GetSpellProto()->Id))
continue;
if (aura && mod->ownerAura != aura)
continue;
// check if mod affected this spell
Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura);
if (iterMod == spell->m_appliedMods.end())
@@ -19653,6 +19656,13 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId)
}
}
void Player::RestoreAllSpellMods(uint32 ownerAuraId, Aura* aura)
{
for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i)
if (m_currentSpells[i])
RestoreSpellMods(m_currentSpells[i], ownerAuraId, aura);
}
void Player::RemoveSpellMods(Spell* spell)
{
if (!spell)