*Fix a infinite loop introduced in 3453. Thanks to QAston and Drahy.
--HG-- branch : trunk
This commit is contained in:
+12
-5
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user