diff options
author | megamage <none@none> | 2009-04-17 15:08:58 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-17 15:08:58 -0500 |
commit | c7d78b5ff930b433c7f09471e825b79e6d9bee4f (patch) | |
tree | 127c9aed7e8ac65d379ac4bcdd18fc73049e3e37 /src/game/Unit.cpp | |
parent | af935468df3af499bcae5018845ea6609f026a5b (diff) |
*Some work on vehicles.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index da197ec7f5c..281679bc3e6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -51,6 +51,7 @@ #include "NullCreatureAI.h" #include "Traveller.h" #include "TemporarySummon.h" +#include "Vehicle.h" #include <math.h> @@ -79,7 +80,7 @@ static bool procPrepared = InitTriggerAuraData(); Unit::Unit() : WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this) , m_IsInNotifyList(false), m_Notified(false), IsAIEnabled(false), NeedChangeAI(false) -, i_AI(NULL), i_disabledAI(NULL), m_removedAurasCount(0) +, i_AI(NULL), i_disabledAI(NULL), m_removedAurasCount(0), m_Vehicle(NULL) { m_objectType |= TYPEMASK_UNIT; m_objectTypeId = TYPEID_UNIT; @@ -10145,6 +10146,7 @@ void Unit::setDeathState(DeathState s) UnsummonAllTotems(); RemoveAllControlled(); RemoveAllAurasOnDeath(); + if(m_Vehicle) m_Vehicle->RemovePassenger(this); //This is needed to clear visible auras after unit dies ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); @@ -11112,6 +11114,7 @@ void Unit::RemoveFromWorld() RemoveCharmAuras(); RemoveBindSightAuras(); RemoveNotOwnSingleTargetAuras(); + if(m_Vehicle) m_Vehicle->RemovePassenger(this); if(GetCharmerGUID()) sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry()); |