From 42498c55e5611ef66bfe8d20a8ef86605d4a2cdb Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Thu, 19 Sep 2024 16:24:24 -0400 Subject: [PATCH 1/2] Fixes Laying Down System --- Content.Client/Standing/LayingDownSystem.cs | 10 ++++++---- Content.Shared/Standing/SharedLayingDownSystem.cs | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Content.Client/Standing/LayingDownSystem.cs b/Content.Client/Standing/LayingDownSystem.cs index 6cc5f7921ac..79932c56c99 100644 --- a/Content.Client/Standing/LayingDownSystem.cs +++ b/Content.Client/Standing/LayingDownSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.ActionBlocker; +using Content.Shared.Buckle; using Content.Shared.Rotation; using Content.Shared.Standing; using Robust.Client.GameObjects; @@ -11,8 +11,9 @@ public sealed class LayingDownSystem : SharedLayingDownSystem { [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private readonly StandingStateSystem _standing = default!; [Dependency] private readonly AnimationPlayerSystem _animation = default!; - [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; + [Dependency] private readonly SharedBuckleSystem _buckle = default!; public override void Initialize() { @@ -26,7 +27,8 @@ public override void Initialize() private void OnMovementInput(EntityUid uid, LayingDownComponent component, MoveEvent args) { if (!_timing.IsFirstTimePredicted - || !_actionBlocker.CanMove(uid) + || !_standing.IsDown(uid) + || _buckle.IsBuckled(uid) || _animation.HasRunningAnimation(uid, "rotate") || !TryComp(uid, out var transform) || !TryComp(uid, out var sprite) @@ -66,4 +68,4 @@ private void OnCheckAutoGetUp(CheckAutoGetUpEvent ev, EntitySessionEventArgs arg rotationVisuals.HorizontalRotation = Angle.FromDegrees(90); } -} +} \ No newline at end of file diff --git a/Content.Shared/Standing/SharedLayingDownSystem.cs b/Content.Shared/Standing/SharedLayingDownSystem.cs index 47ad01949cb..7a82d4b7aa8 100644 --- a/Content.Shared/Standing/SharedLayingDownSystem.cs +++ b/Content.Shared/Standing/SharedLayingDownSystem.cs @@ -40,7 +40,8 @@ public override void Shutdown() private void ToggleStanding(ICommonSession? session) { - if (session?.AttachedEntity == null + if (session is not { AttachedEntity: { Valid: true } uid } _ + || !Exists(uid) || !HasComp(session.AttachedEntity) || _gravity.IsWeightless(session.AttachedEntity.Value)) return; From 480ae517e321082d5cc61b449a7ed89bdfbc0758 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Thu, 19 Sep 2024 16:25:02 -0400 Subject: [PATCH 2/2] Update LayingDownSystem.cs --- Content.Client/Standing/LayingDownSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Client/Standing/LayingDownSystem.cs b/Content.Client/Standing/LayingDownSystem.cs index 79932c56c99..594883ac001 100644 --- a/Content.Client/Standing/LayingDownSystem.cs +++ b/Content.Client/Standing/LayingDownSystem.cs @@ -68,4 +68,4 @@ private void OnCheckAutoGetUp(CheckAutoGetUpEvent ev, EntitySessionEventArgs arg rotationVisuals.HorizontalRotation = Angle.FromDegrees(90); } -} \ No newline at end of file +}