From 80ca59e026f25029173d1b915f1d68113f431336 Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:01:39 +0300 Subject: [PATCH] commit (#434) --- .../Systems/SharedStandingStateSystem.cs | 21 ++++++++++++------- Content.Shared/Stunnable/SharedStunSystem.cs | 6 ++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs index 58344769a7..a13f21a3c7 100644 --- a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs +++ b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs @@ -73,7 +73,7 @@ public abstract partial class SharedStandingStateSystem : EntitySystem if (!TryComp(uid, out StandingStateComponent? standing)) // WD EDIT return; - RaiseNetworkEvent(new CheckAutoGetUpEvent()); + RaiseNetworkEvent(new CheckAutoGetUpEvent()); // WD EDIT if (_stun.IsParalyzed(uid)) { @@ -97,7 +97,7 @@ public abstract partial class SharedStandingStateSystem : EntitySystem private void OnStandingUpDoAfter(EntityUid uid, StandingStateComponent component, StandingUpDoAfterEvent args) { - if (args.Handled) // WD EDIT + if (args.Handled || _stun.IsParalyzed(uid)) // WD EDIT { component.CurrentState = StandingState.Lying; return; @@ -236,12 +236,16 @@ public abstract partial class SharedStandingStateSystem : EntitySystem standingState.CurrentState = StandingState.Lying; Dirty(uid, standingState); - var rotation = _transform.GetWorldRotation(uid); + var rotation = _transform.GetWorldRotation(uid); // WD EDIT + _appearance.TryGetData(uid, BuckleVisuals.Buckled, out var state, appearance); // WD EDIT - if (rotation.GetDir() is Direction.East or Direction.North or Direction.NorthEast or Direction.SouthEast) - _rotation.SetHorizontalAngle(uid, Angle.FromDegrees(270)); - else - _rotation.ResetHorizontalAngle(uid); + if (!state) // WD EDIT + { + if (rotation.GetDir() is Direction.East or Direction.North or Direction.NorthEast or Direction.SouthEast) + _rotation.SetHorizontalAngle(uid, Angle.FromDegrees(270)); + else + _rotation.ResetHorizontalAngle(uid); + } RaiseLocalEvent(uid, new DownedEvent()); @@ -288,6 +292,9 @@ public abstract partial class SharedStandingStateSystem : EntitySystem // Optional component. Resolve(uid, ref appearance, false); + if (TryComp(uid, out BuckleComponent? buckle) && buckle.Buckled && !_buckle.TryUnbuckle(uid, uid, buckleComp: buckle)) // WD EDIT + return false; + if (standingState.CurrentState is StandingState.Standing) return true; diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index f278665576..2931117036 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -115,6 +115,12 @@ public abstract class SharedStunSystem : EntitySystem if (!TryComp(uid, out StandingStateComponent? standing) || !(!standing.CanLieDown || standing.AutoGetUp)) // WD EDIT return; + if (standing.AutoGetUp) // WD EDIT + { + _standingState.TryStandUp(uid, standing); + return; + } + _standingState.Stand(uid, standing); // WD EDIT END }