diff options
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 23 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 |
2 files changed, 11 insertions, 14 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9925f04084b..c28df374b2c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11501,22 +11501,19 @@ void Unit::SetStunned(bool apply) } } -void Unit::SetRooted(bool apply, bool packetOnly /*= false*/) +void Unit::SetRooted(bool apply) { - if (!packetOnly) + if (apply) { - if (apply) - { - // MOVEMENTFLAG_ROOT cannot be used in conjunction with MOVEMENTFLAG_MASK_MOVING (tested 3.3.5a) - // this will freeze clients. That's why we remove MOVEMENTFLAG_MASK_MOVING before - // setting MOVEMENTFLAG_ROOT - RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING); - AddUnitMovementFlag(MOVEMENTFLAG_ROOT); - StopMoving(); - } - else - RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); + // MOVEMENTFLAG_ROOT cannot be used in conjunction with MOVEMENTFLAG_MASK_MOVING (tested 3.3.5a) + // this will freeze clients. That's why we remove MOVEMENTFLAG_MASK_MOVING before + // setting MOVEMENTFLAG_ROOT + RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING); + AddUnitMovementFlag(MOVEMENTFLAG_ROOT); + StopMoving(); } + else + RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); static OpcodeServer const rootOpcodeTable[2][2] = { diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8d5502ff16b..35e2303e6e5 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1988,7 +1988,7 @@ class TC_GAME_API Unit : public WorldObject void SetFeared(bool apply); void SetConfused(bool apply); void SetStunned(bool apply); - void SetRooted(bool apply, bool packetOnly = false); + void SetRooted(bool apply); uint32 m_movementCounter; ///< Incrementing counter used in movement packets |