*Lock on RemoveAllAuras till all auras and applications are removed with all linked events they may cause.
*Add assertion after error log, just in case you've missed it. --HG-- branch : trunk
This commit is contained in:
@@ -4412,6 +4412,10 @@ void Unit::RemoveAreaAurasDueToLeaveWorld()
|
||||
|
||||
void Unit::RemoveAllAuras()
|
||||
{
|
||||
// this may be a dead loop if some events on aura remove will continiously apply aura on remove
|
||||
// we want to have all auras removed, so use your brain when linking events
|
||||
while (!m_appliedAuras.empty() || !m_ownedAuras.empty())
|
||||
{
|
||||
AuraApplicationMap::iterator aurAppIter;
|
||||
for (aurAppIter = m_appliedAuras.begin(); aurAppIter != m_appliedAuras.end();)
|
||||
_UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT);
|
||||
@@ -4419,7 +4423,7 @@ void Unit::RemoveAllAuras()
|
||||
AuraMap::iterator aurIter;
|
||||
for (aurIter = m_ownedAuras.begin(); aurIter != m_ownedAuras.end();)
|
||||
RemoveOwnedAura(aurIter);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveArenaAuras(bool onleave)
|
||||
|
||||
@@ -6631,6 +6631,7 @@ SpellEvent::~SpellEvent()
|
||||
{
|
||||
sLog.outError("~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
|
||||
(m_Spell->GetCaster()->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), m_Spell->GetCaster()->GetGUIDLow(), m_Spell->m_spellInfo->Id);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user