aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-08 21:22:46 +0200
committerQAston <none@none>2009-06-08 21:22:46 +0200
commit0ae0f36f87f9a4f7c062d189c6dae2e2736491ba (patch)
treeadad919dd9e7af16ba696bc629c6f5e2abd942df /src
parent07e868c87cc67063c15bef84c4842618afbec3f1 (diff)
*Fix a crash with sudden death and similar auras.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 939ca9c0c4a..5d804b66537 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17126,24 +17126,28 @@ void Player::RemoveSpellMods(Spell * spell)
std::set <Aura *> checkedSpells;
AuraEffectList const & auraList = GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
- for(AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
+ for(AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end();)
{
- if (!(*itr)->GetParentAura()->GetAuraCharges())
+ AuraEffect * aur = *itr;
+ ++itr;
+ if (!aur->GetParentAura()->GetAuraCharges())
continue;
- SpellEntry const * spellInfo = (*itr)->GetSpellProto();
+
+ SpellEntry const * spellInfo = aur->GetSpellProto();
if (spellInfo->SpellFamilyName != spell->m_spellInfo->SpellFamilyName ||
- checkedSpells.find((*itr)->GetParentAura()) != checkedSpells.end())
+ checkedSpells.find(aur->GetParentAura()) != checkedSpells.end())
continue;
- flag96 const * mask = spellmgr.GetSpellAffect((*itr)->GetId(), (*itr)->GetEffIndex());
+
+ flag96 const * mask = spellmgr.GetSpellAffect(aur->GetId(), aur->GetEffIndex());
if (!mask)
- mask = &spellInfo->EffectSpellClassMask[(*itr)->GetEffIndex()];
+ mask = &spellInfo->EffectSpellClassMask[aur->GetEffIndex()];
if (spell->m_spellInfo->SpellFamilyFlags & *mask)
{
- checkedSpells.insert((*itr)->GetParentAura());
- spell->m_appliedMods.erase((*itr)->GetParentAura());
- if ((*itr)->GetParentAura()->DropAuraCharge())
+ checkedSpells.insert(aur->GetParentAura());
+ spell->m_appliedMods.erase(aur->GetParentAura());
+ if (aur->GetParentAura()->DropAuraCharge())
itr = auraList.begin();
}
}