From f4991543db423f246fb806f0af462d0a610f6b95 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 18 Jan 2009 10:55:16 -0600 Subject: *Fix a crash bug. Do not use 880. --HG-- branch : trunk --- src/game/Unit.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6d2eb1ec4cc..ef2570ddc9a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4662,13 +4662,6 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) Aur->SetStackAmount(0); Aur->_RemoveAura(); - delete Aur; - - if(caster_channeled) - RemoveAurasAtChanneledTarget (AurSpellInfo); - - if(statue) - statue->UnSummon(); if(mode != AURA_REMOVE_BY_STACK) { @@ -4684,6 +4677,14 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) } } + delete Aur; + + if(caster_channeled) + RemoveAurasAtChanneledTarget (AurSpellInfo); + + if(statue) + statue->UnSummon(); + // only way correctly remove all auras from list if( m_Auras.empty() ) i = m_Auras.end(); -- cgit v1.2.3 From a88ee15ef370afb1e53e064e872ddba056c71012 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 18 Jan 2009 11:39:25 -0600 Subject: *Add some debug message to find crash bug. --HG-- branch : trunk --- src/game/Unit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ef2570ddc9a..ed921d85fa5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -258,8 +258,9 @@ Unit::~Unit() if(m_charmInfo) delete m_charmInfo; - RemoveAllAuras(); - assert(m_Auras.begin() == m_Auras.end()); + sLog.outDetail("Deconstruct Unit Entry = %u", GetEntry()); + if(m_scAuras.size()) + sLog.outError("Unit %u has sc auras during deconstruction", GetEntry()); } void Unit::Update( uint32 p_time ) -- cgit v1.2.3