diff options
| author | megamage <none@none> | 2009-05-21 17:18:44 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-05-21 17:18:44 -0500 |
| commit | 67255e536b4091e363df2276676fe5c1241c1cc4 (patch) | |
| tree | 4dd256d93a19501d85b3a4a7b7bb27a5036c2d36 /src | |
| parent | 31005dab8217f988fbbcbcb838d945ef81437a5a (diff) | |
*Fix a infinite loop introduced in 3453. Thanks to QAston and Drahy.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Unit.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6f6d323c2a8..435190b8d10 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3897,16 +3897,20 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) uint32 spellId = Aur->GetId(); // passive spell special case (only non stackable with ranks) - if(IsPassiveSpell(spellId)) - { - if(IsPassiveSpellStackableWithRanks(spellProto)) - return true; - } + if(IsPassiveSpell(spellId) && IsPassiveSpellStackableWithRanks(spellProto)) + return true; //bool linked = spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_LINK_AURA? true : false; + bool remove = false; for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i) { + if(remove) + { + remove = false; + i = m_Auras.begin(); + } + SpellEntry const* i_spellProto = i->second->GetSpellProto(); uint32 i_spellId = i_spellProto->Id; bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID(); @@ -3963,6 +3967,9 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) // Remove all auras by aura caster RemoveAura(i, AURA_REMOVE_BY_STACK); + if(i == m_Auras.end()) + break; + remove = true; } return true; } |
