]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Improve buckling's interactions with standing state (#29741)
authorTayrtahn <tayrtahn@gmail.com>
Sun, 7 Jul 2024 06:20:53 +0000 (02:20 -0400)
committerGitHub <noreply@github.com>
Sun, 7 Jul 2024 06:20:53 +0000 (16:20 +1000)
Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Content.Shared/Standing/StandingStateSystem.cs

index 0ce8c992682bb1df6cb402009c97eb8231049a67..0fbfd51d6985f45dad37b43851f220e74fe7b89e 100644 (file)
@@ -196,7 +196,6 @@ 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);
     }
 
@@ -350,7 +349,6 @@ 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);
 
@@ -363,10 +361,10 @@ public abstract partial class SharedBuckleSystem
         switch (strap.Comp.Position)
         {
             case StrapPosition.Stand:
-                _standing.Stand(buckle);
+                _standing.Stand(buckle, force: true);
                 break;
             case StrapPosition.Down:
-                _standing.Down(buckle, false, false);
+                _standing.Down(buckle, false, false, force: true);
                 break;
         }
 
@@ -458,10 +456,9 @@ 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);
+            _standing.Down(buckle, playSound: false);
         else
             _standing.Stand(buckle);
 
index ed586e970dcd78530f88a1acf975943cbe3cedbf..8d9be9ab7769f5140e006221d09703339a08588c 100644 (file)
@@ -25,7 +25,10 @@ namespace Content.Shared.Standing
             return !standingState.Standing;
         }
 
-        public bool Down(EntityUid uid, bool playSound = true, bool dropHeldItems = true,
+        public bool Down(EntityUid uid,
+            bool playSound = true,
+            bool dropHeldItems = true,
+            bool force = false,
             StandingStateComponent? standingState = null,
             AppearanceComponent? appearance = null,
             HandsComponent? hands = null)
@@ -49,11 +52,14 @@ namespace Content.Shared.Standing
                 RaiseLocalEvent(uid, new DropHandItemsEvent(), false);
             }
 
-            var msg = new DownAttemptEvent();
-            RaiseLocalEvent(uid, msg, false);
+            if (!force)
+            {
+                var msg = new DownAttemptEvent();
+                RaiseLocalEvent(uid, msg, false);
 
-            if (msg.Cancelled)
-                return false;
+                if (msg.Cancelled)
+                    return false;
+            }
 
             standingState.Standing = false;
             Dirty(uid, standingState);