Core/Movement: Fixed possible invalid memory access

This commit is contained in:
Shauren committed 2013-12-12 09:50:52 +01:00
1 parent 385e2dba37
commit 54fd53f7e3
5 files changed
+14 -12

No files matched your search

+3 -2
View File
@@ -165,7 +165,7 @@ Unit::Unit(bool isWorldObject) :
IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(0),
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this),
m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_ThreatManager(this),
m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefManager(this), _lastDamagedTime(0)
{
@@ -293,6 +293,7 @@ Unit::~Unit()
_DeleteRemovedAuras();
delete i_motionMaster;
delete m_charmInfo;
delete movespline;
@@ -362,7 +363,7 @@ void Unit::Update(uint32 p_time)
}
UpdateSplineMovement(p_time);
i_motionMaster.UpdateMotion(p_time);
i_motionMaster->UpdateMotion(p_time);
}
bool Unit::haveOffhandWeapon() const