Core/Player: Added value for counting root times, used by SMSG_FORCE_MOVE_ROOT & SMSG_FORCE_MOVE_UNROOT. Actually I am not sure for what it is. Thanks to linencloth for help.

--HG--
branch : trunk
This commit is contained in:
_manuel_
2010-10-05 23:02:46 -03:00
parent f745705ef9
commit 4aff9d0203
2 changed files with 11 additions and 2 deletions

View File

@@ -122,6 +122,8 @@ m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this)
m_extraAttacks = 0;
m_canDualWield = false;
m_rootTimes = 0;
m_state = 0;
m_form = FORM_NONE;
m_deathState = ALIVE;
@@ -15354,11 +15356,14 @@ void Unit::SetRooted(bool apply)
{
if (apply)
{
if (m_rootTimes > 0) //blizzard internal check?
m_rootTimes++;
// AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10);
data.append(GetPackGUID());
data << (uint32)2;
data << m_rootTimes;
SendMessageToSet(&data,true);
if (GetTypeId() != TYPEID_PLAYER)
@@ -15368,9 +15373,11 @@ void Unit::SetRooted(bool apply)
{
if (!hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect
{
m_rootTimes++; //blizzard internal check?
WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10);
data.append(GetPackGUID());
data << (uint32)2;
data << m_rootTimes;
SendMessageToSet(&data,true);
// RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT);

View File

@@ -2092,6 +2092,8 @@ class Unit : public WorldObject
void SetStunned(bool apply);
void SetRooted(bool apply);
uint32 m_rootTimes;
uint32 m_state; // Even derived shouldn't modify
uint32 m_CombatTimer;
uint32 m_lastManaUse; // msecs