Skip to content

Commit

Permalink
Use required number of legs to determine if standing fails (#2761)
Browse files Browse the repository at this point in the history
* Use required number of legs to determine if standing fails

* Add check to TryStandUp which validates if an entity can even get up
  • Loading branch information
BarryNorfolk authored Jan 18, 2025
1 parent 0bacdfd commit e81b041
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Content.Shared/Body/Systems/SharedBodySystem.Body.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ private void OnProfileLoadFinished(EntityUid uid, BodyComponent component, Profi

private void OnStandAttempt(Entity<BodyComponent> ent, ref StandAttemptEvent args)
{
if (ent.Comp.LegEntities.Count == 0)
if (ent.Comp.LegEntities.Count < ent.Comp.RequiredLegs) // DeltaV
args.Cancel();
}

Expand Down
8 changes: 8 additions & 0 deletions Content.Shared/_White/Standing/SharedLayingDownSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ standingState.CurrentState is not StandingState.Lying ||
HasComp<DebrainedComponent>(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,
Expand Down

0 comments on commit e81b041

Please sign in to comment.