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 1355fa5f2..f09978dd1 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 6105ece65..ee3c42680 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 d7ca6ae7a..21371f287 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 e792559cc..953600522 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 a3259aa2d..dba30f176 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;