]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix weird rotation when strapped to a bed (#24746)
authorTayrtahn <tayrtahn@gmail.com>
Tue, 30 Jan 2024 23:23:30 +0000 (18:23 -0500)
committerGitHub <noreply@github.com>
Tue, 30 Jan 2024 23:23:30 +0000 (16:23 -0700)
* Gotta watch out for those tricky radians

* Change StrapComponent instead

Content.Shared/Buckle/Components/StrapComponent.cs
Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs

index 46f260741a73c725beed64e9b0a848fd64687f0b..b0f37a8dafb0e94d0a5c0aea6f78b9b69b4a2571 100644 (file)
@@ -66,11 +66,11 @@ public sealed partial class StrapComponent : Component
     public Vector2 BuckleOffset = Vector2.Zero;
 
     /// <summary>
-    /// The angle in degrees to rotate the player by when they get strapped
+    /// The angle to rotate the player by when they get strapped
     /// </summary>
     [DataField]
     [ViewVariables(VVAccess.ReadWrite)]
-    public int Rotation;
+    public Angle Rotation;
 
     /// <summary>
     /// The size of the strap which is compared against when buckling entities
index 9b2b8ce4c8a984e8322d24a7f49f7c7524cbe3ab..cfaea47d304c01b3d85f2d1d30e2afa023d34848 100644 (file)
@@ -357,7 +357,7 @@ public abstract partial class SharedBuckleSystem
         if (TryComp<AppearanceComponent>(buckleUid, out var appearance))
             Appearance.SetData(buckleUid, BuckleVisuals.Buckled, true, appearance);
 
-        _rotationVisuals.SetHorizontalAngle(buckleUid,  strapComp.Rotation);
+        _rotationVisuals.SetHorizontalAngle(buckleUid, strapComp.Rotation);
 
         ReAttach(buckleUid, strapUid, buckleComp, strapComp);
         SetBuckledTo(buckleUid, strapUid, strapComp, buckleComp);