diff options
author | QAston <none@none> | 2010-01-18 18:42:36 +0100 |
---|---|---|
committer | QAston <none@none> | 2010-01-18 18:42:36 +0100 |
commit | 9a7746c9fcfe97edb044bde559b14d09d12f8e13 (patch) | |
tree | 320a6b34bd163aa605eb03b7fbb98e6dd248885b /src/game/Unit.cpp | |
parent | 844c09fc6153f99247318d521e68a47ba4d7d094 (diff) |
*Add some debug info to trac reason of assertion fail in Unit destructor.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 04102254a65..e52faf0e875 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -182,6 +182,8 @@ Unit::Unit() // remove aurastates allowing special moves for (uint8 i = 0; i < MAX_REACTIVE; ++i) m_reactiveTimer[i] = 0; + + m_cleanupDone = false; } Unit::~Unit() @@ -205,6 +207,7 @@ Unit::~Unit() if (m_vehicleKit) delete m_vehicleKit; + assert(m_cleanupDone); assert(!m_attacking); assert(m_attackers.empty()); assert(m_sharedVision.empty()); @@ -3234,8 +3237,7 @@ void Unit::_UpdateSpells( uint32 time ) } } - // update auraBases - // m_auraBaseUpdateIterator can be updated in indirect called code at aura remove to skip next planned to update but removed auras + // m_auraUpdateIterator can be updated in indirect called code at aura remove to skip next planned to update but removed auras for (m_auraUpdateIterator = m_ownedAuras.begin(); m_auraUpdateIterator != m_ownedAuras.end();) { Aura * i_aura = m_auraUpdateIterator->second; @@ -3529,6 +3531,7 @@ void Unit::DeMorph() void Unit::_AddAura(UnitAura * aura, Unit * caster) { + assert(!m_cleanupDone); m_ownedAuras.insert(AuraMap::value_type(aura->GetId(), aura)); // passive and Incanter's Absorption and auras with different type can stack with themselves any number of times @@ -3579,7 +3582,8 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster) AuraApplication * Unit::__ApplyAura(Aura * aura) { - // auraBase musn't be removed + assert(!m_cleanupDone); + // aura musn't be removed assert(!aura->IsRemoved()); SpellEntry const* aurSpellInfo = aura->GetSpellProto(); @@ -12965,6 +12969,7 @@ void Unit::CleanupsBeforeDelete() //A unit may be in removelist and not in world, but it is still in grid //and may have some references during delete RemoveAllAuras(); + m_cleanupDone = true; InterruptNonMeleeSpells(true); m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList CombatStop(); |