aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Creature.cpp12
-rw-r--r--src/game/ObjectGridLoader.cpp1
-rw-r--r--src/game/Unit.cpp16
3 files changed, 9 insertions, 20 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 7d0db29b68c..8c120309217 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -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()
diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp
index 14b1865cfa7..0c1de5859e9 100644
--- a/src/game/ObjectGridLoader.cpp
+++ b/src/game/ObjectGridLoader.cpp
@@ -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;
}
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 159ce634a2d..ac6881a4356 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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 )