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:
Machiavelli
2011-06-26 21:36:20 +02:00
parent ad81d4132c
commit 6ce529aff3

View File

@@ -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);
}
}
}