From 6ce529aff3250a80cb0b2f935a181aa61ae62f7f Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 26 Jun 2011 21:36:20 +0200 Subject: 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 --- src/server/game/Entities/Unit/Unit.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index dedfb4b28d1..a716748d5f6 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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); } } } -- cgit v1.2.3