*Try to fix a crash bug.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-24 22:25:22 -06:00
parent 8413356d0e
commit fe08615d17
3 changed files with 9 additions and 20 deletions
+8 -4
View File
@@ -162,12 +162,16 @@ m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTabl
Creature::~Creature()
{
CleanupsBeforeDelete();
m_vendorItemCounts.clear();
delete i_AI;
i_AI = NULL;
if(i_AI)
{
delete i_AI;
i_AI = NULL;
}
if(m_uint32Values)
sLog.outDetail("Deconstruct Creature Entry = %u", GetEntry());
}
void Creature::AddToWorld()
+1
View File
@@ -285,6 +285,7 @@ ObjectGridUnloader::Visit(CreatureMapType &m)
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
obj->SaveRespawnTime();
///- object will get delinked from the manager when deleted
obj->CleanupsBeforeDelete();
delete obj;
}
}
-16
View File
@@ -260,22 +260,6 @@ Unit::~Unit()
RemoveAllDynObjects();
if(m_charmInfo) delete m_charmInfo;
if(m_uint32Values)
{
sLog.outDetail("Deconstruct Unit Entry = %u", GetEntry());
/*for(int i = 0; i < TOTAL_AURAS; ++i)
{
if(m_modAuras[i].begin() != m_modAuras[i].end())
sLog.outError("Unit %u has mod auras during deconstruction", GetEntry());
}
if(m_scAuras.begin() != m_scAuras.end())
sLog.outError("Unit %u has sc auras during deconstruction", GetEntry());
if(m_interruptableAuras.begin() != m_interruptableAuras.end())
sLog.outError("Unit %u has interruptable auras during deconstruction", GetEntry());
if(m_ccAuras.begin() != m_ccAuras.end())
sLog.outError("Unit %u has cc auras during deconstruction", GetEntry());*/
}
}
void Unit::Update( uint32 p_time )