Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Content.Shared/_White/Standing/SharedLayingDownSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void ToggleStanding(ICommonSession? session)
{
if (session?.AttachedEntity == null ||
!HasComp<LayingDownComponent>(session.AttachedEntity) ||
_gravity.IsWeightless(session.AttachedEntity.Value))
!CanLieDown(session.AttachedEntity.Value)) // Exodus
{
return;
}
Expand Down Expand Up @@ -112,7 +112,7 @@ private void OnParentChanged(EntityUid uid, LayingDownComponent component, EntPa
// If the entity is not on a grid, try to make it stand up to avoid issues
if (!TryComp<StandingStateComponent>(uid, out var standingState)
|| standingState.CurrentState is StandingState.Standing
|| Transform(uid).GridUid != null)
|| CanLieDown(uid)) // Exodus
{
return;
}
Expand Down Expand Up @@ -150,7 +150,8 @@ public bool TryLieDown(EntityUid uid, LayingDownComponent? layingDown = null, St
{
if (!Resolve(uid, ref standingState, false) ||
!Resolve(uid, ref layingDown, false) ||
standingState.CurrentState is not StandingState.Standing)
standingState.CurrentState is not StandingState.Standing ||
!CanLieDown(uid)) // Exodus
{
if (behavior == DropHeldItemsBehavior.AlwaysDrop)
{
Expand All @@ -163,6 +164,12 @@ public bool TryLieDown(EntityUid uid, LayingDownComponent? layingDown = null, St
_standing.Down(uid, true, behavior != DropHeldItemsBehavior.NoDrop, false, standingState);
return true;
}

// Exodus
private bool CanLieDown(EntityUid uid)
{
return _gravity.EntityOnGravitySupportingGridOrMap(uid);
}
}

[Serializable, NetSerializable]
Expand Down
Loading