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
This commit is contained in:
BarryNorfolk 2025-01-18 02:54:23 +01:00 committed by GitHub
parent 0bacdfdb75
commit e81b0411b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -462,7 +462,7 @@ public partial class SharedBodySystem
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();
}

View File

@ -126,6 +126,14 @@ public abstract class SharedLayingDownSystem : EntitySystem
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,