From caf9b7d356d49ce8a7a91c77bde6caae2934c580 Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 19 Apr 2009 22:21:40 +0200 Subject: *Prevent crash in EffectDispelMechanic. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/game/SpellEffects.cpp') diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index cd1471055cb..f69bc3db828 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5902,23 +5902,20 @@ void Spell::EffectDispelMechanic(uint32 i) uint32 mechanic = m_spellInfo->EffectMiscValue[i]; - std::queue < Aura * > dispel_list; + std::queue < std::pair < uint32, uint64 > > dispel_list; Unit::AuraMap& Auras = unitTarget->GetAuras(); for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end(); iter++) { - if(GetAllSpellMechanicMask(iter->second->GetSpellProto()) & (1<<(mechanic))) + if((GetAllSpellMechanicMask(iter->second->GetSpellProto()) & (1<<(mechanic))) && GetDispelChance(iter->second->GetCaster(), iter->second->GetId())) { - dispel_list.push(iter->second); + dispel_list.push(std::make_pair(iter->second->GetId(), iter->second->GetCasterGUID() ) ); } } for(;dispel_list.size();dispel_list.pop()) { - if (GetDispelChance(dispel_list.front()->GetCaster(), dispel_list.front()->GetId())) - { - unitTarget->RemoveAura(dispel_list.front(), AURA_REMOVE_BY_ENEMY_SPELL); - } + unitTarget->RemoveAura(dispel_list.front().first, dispel_list.front().second, AURA_REMOVE_BY_ENEMY_SPELL); } } -- cgit v1.2.3