diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 316d9b8690..321dfbd3a2 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -25,4 +25,22 @@ public sealed partial class CCVars : CVars /// public static readonly CVarDef DebugPow3rDisableParallel = CVarDef.Create("debug.pow3r_disable_parallel", true, CVar.SERVERONLY); + + // ADT Tweak start + #region Jetpack System + + /// + /// When true, Jetpacks can be enabled anywhere, even in gravity. + /// + public static readonly CVarDef JetpackEnableAnywhere = + CVarDef.Create("jetpack.enable_anywhere", false, CVar.REPLICATED); + + /// + /// When true, jetpacks can be enabled on grids that have zero gravity. + /// + public static readonly CVarDef JetpackEnableInNoGravity = + CVarDef.Create("jetpack.enable_in_no_gravity", true, CVar.REPLICATED); + + #endregion + // ADT Tweak End } diff --git a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs index 548594c01f..c4010848e1 100644 --- a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs +++ b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs @@ -1,9 +1,11 @@ using Content.Shared.Actions; +using Content.Shared.CCVar; using Content.Shared.Gravity; using Content.Shared.Interaction.Events; using Content.Shared.Movement.Components; using Content.Shared.Movement.Events; using Content.Shared.Popups; +using Robust.Shared.Configuration; using Robust.Shared.Containers; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; @@ -20,6 +22,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 IConfigurationManager _config = default!; public override void Initialize() { @@ -127,8 +130,15 @@ private bool CanEnableOnGrid(EntityUid? gridUid) { // No and no again! Do not attempt to activate the jetpack on a grid with gravity disabled. You will not be the first or the last to try this. // https://discord.com/channels/310555209753690112/310555209753690112/1270067921682694234 - return gridUid == null || - (!HasComp(gridUid)); + + // ADT Tweak start + // return gridUid == null || + // (!HasComp(gridUid)); + if (gridUid == null || !TryComp(gridUid, out var comp)) + return true; + + return !comp.Enabled; + // ADT Tweak End } private void OnJetpackGetAction(EntityUid uid, JetpackComponent component, GetItemActionsEvent args)