*Cleanup, and fix a likely infinite loop, thanks thenecromancer

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-17 04:33:11 -07:00
parent 68e86ccb7b
commit d088564403
4 changed files with 9 additions and 9 deletions

View File

@@ -4135,13 +4135,13 @@ void Unit::RemoveAllAuras()
void Unit::RemoveAllAuras(uint64 casterGUID, Aura * except /*=NULL*/, bool negative /*=true*/, bool positive /*=true*/)
{
AuraMap::iterator iter = m_Auras.begin();
while (!m_Auras.empty())
for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();)
{
Aura * aur = (*iter).second;
if (aur != except && (!casterGUID || aur->GetCasterGUID()==casterGUID)
&& ((negative && !aur->IsPositive()) || (positive && aur->IsPositive())))
RemoveAura(aur);
if (iter->second != except && (!casterGUID || iter->second->GetCasterGUID()==casterGUID)
&& ((negative && !iter->second->IsPositive()) || (positive && iter->second->IsPositive())))
RemoveAura(iter);
else
++iter;
}
}