mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Entities: Add MOVEMENTFLAG_ROOT to unit on Unit::SetStunned, and remove any other conflicting movement flags that might freeze clients.
This *properly* fixes the ancient root freeze issue that surfaced during the early stages of 3.x
This commit is contained in:
@@ -15620,7 +15620,10 @@ void Unit::SetStunned(bool apply)
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
// AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
// MOVEMENTFLAG_ROOT cannot be used in conjunction with ie. MOVEMENTFLAG_FORWARD,
|
||||
// this will freeze clients. That's why we remove any current movement flags before
|
||||
// setting MOVEMENTFLAG_ROOT
|
||||
SetUnitMovementFlags(MOVEMENTFLAG_ROOT);
|
||||
|
||||
// Creature specific
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
@@ -15652,7 +15655,7 @@ void Unit::SetStunned(bool apply)
|
||||
data << uint32(0);
|
||||
SendMessageToSet(&data, true);
|
||||
|
||||
// RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user