aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-28 10:00:27 -0600
committermegamage <none@none>2008-12-28 10:00:27 -0600
commitf650b55c2300870f0a7fa0d3d24a0c7d30aaaf31 (patch)
tree83fd3e2fc47fc6409145a97b97716f5fa84d5a88 /src
parent1a53ea2c02ed0fd865798e2c3b97b2871944d971 (diff)
*Fix the bug that ~Unit makes crash.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b726e78c69e..1fed4717db6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11095,6 +11095,8 @@ void Unit::CleanupsBeforeDelete()
{
if(m_uint32Values) // only for fully created object
{
+ UnpossessSelf(false);
+ RemoveAllFromVision();
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();
@@ -11104,8 +11106,6 @@ void Unit::CleanupsBeforeDelete()
RemoveAllAuras();
RemoveAllGameObjects();
RemoveAllDynObjects();
- UnpossessSelf(false);
- RemoveAllFromVision();
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
}
RemoveFromWorld();