diff options
author | QAston <none@none> | 2010-01-12 00:14:09 +0100 |
---|---|---|
committer | QAston <none@none> | 2010-01-12 00:14:09 +0100 |
commit | 758baae61b6cdce9588964cf44675b1c8ab9b4f8 (patch) | |
tree | 4c4023ffc0ad2dab71a976238877e8968917dd67 /src | |
parent | 3ddea83ffa0f5ec5f93b0e8af8a0fb5fcb6752eb (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')
-rw-r--r-- | src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp | 2 | ||||
-rw-r--r-- | src/game/DynamicObject.cpp | 2 | ||||
-rw-r--r-- | src/game/Map.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 15 | ||||
-rw-r--r-- | src/game/Unit.h | 2 |
5 files changed, 13 insertions, 10 deletions
diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp index 1355fa5f245..f09978dd11b 100644 --- a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp @@ -682,7 +682,7 @@ struct TRINITY_DLL_DECL dummy_dragonAI : public ScriptedAI DoScriptText(iTextId, m_creature); - m_creature->RemoveOwnedAura(uiSpellId, AURA_REMOVE_BY_DEFAULT); + m_creature->RemoveOwnedAura(uiSpellId); if (pInstance) { diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 6105ece654e..ee3c42680ec 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -179,4 +179,4 @@ bool DynamicObject::isVisibleForInState(Player const* u, bool inVisibleList) con { return IsInWorld() && u->IsInWorld() && (IsWithinDistInMap(u->m_seer,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false)); -}
\ No newline at end of file +} diff --git a/src/game/Map.cpp b/src/game/Map.cpp index d7ca6ae7a70..21371f28726 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -2440,7 +2440,7 @@ void Map::RemoveAllObjectsInRemoveList() case TYPEID_UNIT: // in case triggered sequence some spell can continue casting after prev CleanupsBeforeDelete call // make sure that like sources auras/etc removed before destructor start - ((Creature*)obj)->CleanupsBeforeDelete (); + ((Creature*)obj)->CleanupsBeforeDelete(); Remove((Creature*)obj,true); break; default: 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) diff --git a/src/game/Unit.h b/src/game/Unit.h index a3259aa2d1c..dba30f176f5 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1545,7 +1545,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject AuraMap const& GetOwnedAuras() const { return m_ownedAuras; } void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT); - void RemoveOwnedAura(uint32 spellId, uint64 caster, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT); + void RemoveOwnedAura(uint32 spellId, uint64 caster = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT); void RemoveOwnedAura(Aura * aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT); Aura * GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint8 reqEffMask = 0) const; |