From 91a25b15119211e8c018d9e9c675d8904598d1f2 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Fri, 17 Jan 2025 17:35:38 +0100 Subject: [PATCH 1/2] Use required number of legs to determine if standing fails --- Content.Shared/Body/Systems/SharedBodySystem.Body.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs index f3361872701..45935566e17 100644 --- a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs +++ b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs @@ -462,7 +462,7 @@ private void OnProfileLoadFinished(EntityUid uid, BodyComponent component, Profi private void OnStandAttempt(Entity ent, ref StandAttemptEvent args) { - if (ent.Comp.LegEntities.Count == 0) + if (ent.Comp.LegEntities.Count < ent.Comp.RequiredLegs) // DeltaV args.Cancel(); } From f5264bcf9f6e4d8d65acb2785cc032eb33b21d70 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Fri, 17 Jan 2025 17:55:23 +0100 Subject: [PATCH 2/2] Add check to TryStandUp which validates if an entity can even get up --- Content.Shared/_White/Standing/SharedLayingDownSystem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Shared/_White/Standing/SharedLayingDownSystem.cs b/Content.Shared/_White/Standing/SharedLayingDownSystem.cs index c772a1cb3f5..a3b5e348e94 100644 --- a/Content.Shared/_White/Standing/SharedLayingDownSystem.cs +++ b/Content.Shared/_White/Standing/SharedLayingDownSystem.cs @@ -126,6 +126,14 @@ standingState.CurrentState is not StandingState.Lying || HasComp(uid)) return false; + // Begin DeltaV Addition + // Don't allow users to start trying to stand if they couldn't stand anyway + var msg = new StandAttemptEvent(); + RaiseLocalEvent(uid, msg, false); + if (msg.Cancelled) + return false; + // End DeltaV Addition + var args = new DoAfterArgs(EntityManager, uid, layingDown.StandingUpTime, new StandingUpDoAfterEvent(), uid) { BreakOnHandChange = false,