From e81b0411b74a1eae6bd029727d97cb6dac2bf8e5 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Sat, 18 Jan 2025 02:54:23 +0100 Subject: [PATCH] Use required number of legs to determine if standing fails (#2761) * Use required number of legs to determine if standing fails * Add check to TryStandUp which validates if an entity can even get up --- Content.Shared/Body/Systems/SharedBodySystem.Body.cs | 2 +- Content.Shared/_White/Standing/SharedLayingDownSystem.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 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(); } 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,