Fix some mispredict reconciliation issues. (#6319)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Leon Friedrich
2022-01-31 05:34:48 +13:00
committed by GitHub
parent 90b2f716a4
commit d40bcc9168
15 changed files with 110 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Content.Shared.Rotation;
using JetBrains.Annotations;
using Robust.Client.Animations;
@@ -17,17 +17,17 @@ namespace Content.Client.Rotation
{
base.OnChangeData(component);
if (component.TryGetData<RotationState>(RotationVisuals.RotationState, out var state))
// if TryGet fails, state defaults to RotationState.Vertical.
component.TryGetData<RotationState>(RotationVisuals.RotationState, out var state);
switch (state)
{
switch (state)
{
case RotationState.Vertical:
SetRotation(component, 0);
break;
case RotationState.Horizontal:
SetRotation(component, Angle.FromDegrees(90));
break;
}
case RotationState.Vertical:
SetRotation(component, 0);
break;
case RotationState.Horizontal:
SetRotation(component, Angle.FromDegrees(90));
break;
}
}