*Fix a infinite loop introduced in 3453. Thanks to QAston and Drahy.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-21 17:18:44 -05:00
parent 31005dab82
commit 67255e536b
+12 -5
View File
@@ -3897,16 +3897,20 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
uint32 spellId = Aur->GetId(); uint32 spellId = Aur->GetId();
// passive spell special case (only non stackable with ranks) // passive spell special case (only non stackable with ranks)
if(IsPassiveSpell(spellId)) if(IsPassiveSpell(spellId) && IsPassiveSpellStackableWithRanks(spellProto))
{ return true;
if(IsPassiveSpellStackableWithRanks(spellProto))
return true;
}
//bool linked = spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_LINK_AURA? true : false; //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) 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(); SpellEntry const* i_spellProto = i->second->GetSpellProto();
uint32 i_spellId = i_spellProto->Id; uint32 i_spellId = i_spellProto->Id;
bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID(); bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID();
@@ -3963,6 +3967,9 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
// Remove all auras by aura caster // Remove all auras by aura caster
RemoveAura(i, AURA_REMOVE_BY_STACK); RemoveAura(i, AURA_REMOVE_BY_STACK);
if(i == m_Auras.end())
break;
remove = true;
} }
return true; return true;
} }