diff options
| author | QAston <none@none> | 2009-04-19 22:21:40 +0200 |
|---|---|---|
| committer | QAston <none@none> | 2009-04-19 22:21:40 +0200 |
| commit | caf9b7d356d49ce8a7a91c77bde6caae2934c580 (patch) | |
| tree | 076375761c6096ee74b3aa0ff39010fc838d1412 /src/game/SpellEffects.cpp | |
| parent | b1360dc1e82403ba9910cc8b3a88dcd1b31b2ec9 (diff) | |
*Prevent crash in EffectDispelMechanic.
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
| -rw-r--r-- | src/game/SpellEffects.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
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); } } |
