*Make sure that any aura (in case of aura remove linked auras for example) won't survive Unit::RemoveAllAuras.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-01-12 00:14:09 +01:00
parent 3ddea83ffa
commit 758baae61b
5 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -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));
}␍
}
+1 -1
View File
@@ -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:
+9 -6
View File
@@ -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)
+1 -1
View File
@@ -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;