From d7875a0d4eee18ad6409cbdd8d4d997814790293 Mon Sep 17 00:00:00 2001 From: fox Date: Wed, 17 Jul 2024 22:12:13 +0300 Subject: [PATCH] don't allow jetpacking while downed --- Content.Shared/Movement/Systems/SharedJetpackSystem.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs index 8c42511f846..186c7e68df6 100644 --- a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs +++ b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs @@ -4,6 +4,7 @@ using Content.Shared.Movement.Components; using Content.Shared.Movement.Events; using Content.Shared.Popups; +using Content.Shared.Standing; using Robust.Shared.Containers; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; @@ -20,6 +21,7 @@ public abstract class SharedJetpackSystem : EntitySystem [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly ActionContainerSystem _actionContainer = default!; + [Dependency] private readonly StandingStateSystem _standing = default!; public override void Initialize() { @@ -44,6 +46,10 @@ private void OnMapInit(EntityUid uid, JetpackComponent component, MapInitEvent a private void OnJetpackCanWeightlessMove(EntityUid uid, JetpackComponent component, ref CanWeightlessMoveEvent args) { + Container.TryGetContainingContainer(uid, out var container); + if (container?.Owner is { } owner && _standing.IsDown(owner)) + return; + args.CanMove = true; } @@ -72,6 +78,9 @@ private void OnJetpackDropped(EntityUid uid, JetpackComponent component, Dropped private void OnJetpackUserCanWeightless(EntityUid uid, JetpackUserComponent component, ref CanWeightlessMoveEvent args) { + if (_standing.IsDown(uid)) + return; + args.CanMove = true; }