diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-09-25 00:30:54 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-09-25 00:30:54 +0200 |
commit | 88d878375899769a894fd7edf31d5386effcd6c5 (patch) | |
tree | 4e9e7745f3bb992a6b2d8a10351a840991fee95e | |
parent | 5116221caae5f31f2a39b938ea7eed0115517ae1 (diff) |
Core/Units: Remove unused argument from Unit::SetRooted
-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 |