aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2010-01-12 00:14:09 +0100
committerQAston <none@none>2010-01-12 00:14:09 +0100
commit758baae61b6cdce9588964cf44675b1c8ab9b4f8 (patch)
tree4c4023ffc0ad2dab71a976238877e8968917dd67 /src/game/Unit.cpp
parent3ddea83ffa0f5ec5f93b0e8af8a0fb5fcb6752eb (diff)
*Make sure that any aura (in case of aura remove linked auras for example) won't survive Unit::RemoveAllAuras.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e792559cce4..95360052238 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4279,13 +4279,16 @@ void Unit::RemoveAreaAurasDueToLeaveWorld()
void Unit::RemoveAllAuras()
{
- AuraApplicationMap::iterator aurAppIter = m_appliedAuras.begin();
- while (!m_appliedAuras.empty())
- _UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT);
+ while (!m_appliedAuras.empty() || !m_ownedAuras.empty())
+ {
+ AuraApplicationMap::iterator aurAppIter = m_appliedAuras.begin();
+ while (!m_appliedAuras.empty())
+ _UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT);
- AuraMap::iterator aurIter = m_ownedAuras.begin();
- while (!m_ownedAuras.empty())
- RemoveOwnedAura(aurIter);
+ AuraMap::iterator aurIter = m_ownedAuras.begin();
+ while (!m_ownedAuras.empty())
+ RemoveOwnedAura(aurIter);
+ }
}
void Unit::RemoveArenaAuras(bool onleave)