diff options
| author | maximius <none@none> | 2009-10-17 04:33:11 -0700 |
|---|---|---|
| committer | maximius <none@none> | 2009-10-17 04:33:11 -0700 |
| commit | d088564403f4d7c5bc977f227b9a1725200a449a (patch) | |
| tree | 721b27e3684410dd0e7586d00907c65927bc9394 /src/game | |
| parent | 68e86ccb7bd9239b71415d39d1004ae15296693c (diff) | |
*Cleanup, and fix a likely infinite loop, thanks thenecromancer
--HG--
branch : trunk
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/Unit.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ec132ee3e7b..94a88fba710 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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; } } |
