aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-09-25 00:30:54 +0200
committerShauren <shauren.trinity@gmail.com>2025-09-25 00:30:54 +0200
commit88d878375899769a894fd7edf31d5386effcd6c5 (patch)
tree4e9e7745f3bb992a6b2d8a10351a840991fee95e /src
parent5116221caae5f31f2a39b938ea7eed0115517ae1 (diff)
Core/Units: Remove unused argument from Unit::SetRooted
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp23
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
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