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:
parent
0bacdfdb75
commit
e81b0411b7
|
|
@ -462,7 +462,7 @@ public partial class SharedBodySystem
|
||||||
|
|
||||||
private void OnStandAttempt(Entity<BodyComponent> ent, ref StandAttemptEvent args)
|
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();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,14 @@ public abstract class SharedLayingDownSystem : EntitySystem
|
||||||
HasComp<DebrainedComponent>(uid))
|
HasComp<DebrainedComponent>(uid))
|
||||||
return false;
|
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)
|
var args = new DoAfterArgs(EntityManager, uid, layingDown.StandingUpTime, new StandingUpDoAfterEvent(), uid)
|
||||||
{
|
{
|
||||||
BreakOnHandChange = false,
|
BreakOnHandChange = false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue