]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixed buckled players thrashing while speaking in beds (#29653)
authorTayrtahn <tayrtahn@gmail.com>
Tue, 2 Jul 2024 03:30:53 +0000 (23:30 -0400)
committerGitHub <noreply@github.com>
Tue, 2 Jul 2024 03:30:53 +0000 (23:30 -0400)
* Fix characters thrashing when talking while lying down

* Remove weird design choice

Content.Client/Rotation/RotationVisualizerSystem.cs
Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs

index 6105c10c8033fe1ffb40df73754e228f625cc0dc..6d3be4d1c05dedc2eb7cf3e8732024740d3ce6ac 100644 (file)
@@ -23,8 +23,8 @@ public sealed class RotationVisualizerSystem : SharedRotationVisualsSystem
         if (args.Sprite == null)
             return;
 
-        // If not defined, defaults to standing.
-        _appearance.TryGetData<RotationState>(uid, RotationVisuals.RotationState, out var state, args.Component);
+        if (!_appearance.TryGetData<RotationState>(uid, RotationVisuals.RotationState, out var state, args.Component))
+            return;
 
         switch (state)
         {
index fd6ffd30e39c6036ce4cdd878dc53575bdaee956..0ce8c992682bb1df6cb402009c97eb8231049a67 100644 (file)
@@ -9,6 +9,7 @@ using Content.Shared.Movement.Events;
 using Content.Shared.Movement.Pulling.Events;
 using Content.Shared.Popups;
 using Content.Shared.Pulling.Events;
+using Content.Shared.Rotation;
 using Content.Shared.Standing;
 using Content.Shared.Storage.Components;
 using Content.Shared.Stunnable;
@@ -195,6 +196,7 @@ public abstract partial class SharedBuckleSystem
         buckle.Comp.BuckleTime = _gameTiming.CurTime;
         ActionBlocker.UpdateCanMove(buckle);
         Appearance.SetData(buckle, StrapVisuals.State, buckle.Comp.Buckled);
+        Appearance.SetData(buckle, RotationVisuals.RotationState, RotationState.Horizontal);
         Dirty(buckle);
     }
 
@@ -348,6 +350,7 @@ public abstract partial class SharedBuckleSystem
         SetBuckledTo(buckle, strap!);
         Appearance.SetData(strap, StrapVisuals.State, true);
         Appearance.SetData(buckle, BuckleVisuals.Buckled, true);
+        Appearance.SetData(buckle, RotationVisuals.RotationState, RotationState.Horizontal);
 
         _rotationVisuals.SetHorizontalAngle(buckle.Owner, strap.Comp.Rotation);
 
@@ -455,6 +458,7 @@ public abstract partial class SharedBuckleSystem
         _rotationVisuals.ResetHorizontalAngle(buckle.Owner);
         Appearance.SetData(strap, StrapVisuals.State, strap.Comp.BuckledEntities.Count != 0);
         Appearance.SetData(buckle, BuckleVisuals.Buckled, false);
+        Appearance.SetData(buckle, RotationVisuals.RotationState, RotationState.Vertical);
 
         if (HasComp<KnockedDownComponent>(buckle) || _mobState.IsIncapacitated(buckle))
             _standing.Down(buckle);