Core/PacketIO: Send proper SPLINE_ROOT packets for stunned creatures

This commit is contained in:
Shauren committed 2013-06-23 20:15:02 +02:00
1 parent 9d9a92a56d
commit ab601de6af
1 file changed
+2 -11
+2 -11
View File
@@ -14428,19 +14428,13 @@ void Unit::SetStunned(bool apply)
SetTarget(0);
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
// 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);
// Creature specific
if (GetTypeId() != TYPEID_PLAYER)
ToCreature()->StopMoving();
else
SetStandState(UNIT_STAND_STATE_STAND);
SendMoveRoot(0);
SetRooted(true);
CastStop();
}
@@ -14455,10 +14449,7 @@ void Unit::SetStunned(bool apply)
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect
{
SendMoveUnroot(0);
RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT);
}
SetRooted(false);
}
}