]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Option to disable Crawling in Cvar (#39739)
authorInsoPL <lukasz.lindert@protonmail.com>
Tue, 26 Aug 2025 19:32:45 +0000 (21:32 +0200)
committerGitHub <noreply@github.com>
Tue, 26 Aug 2025 19:32:45 +0000 (12:32 -0700)
Content.Shared/CCVar/CCVars.Movement.cs
Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs

index 37e355b0321c1b63a3826c4dc62e61fa82512750..96ceada0994a074eef428d2bd7cbcad988db770d 100644 (file)
@@ -56,4 +56,12 @@ public sealed partial class CCVars
     [CVarControl(AdminFlags.VarEdit)]
     public static readonly CVarDef<float> MovementPushMassCap =
         CVarDef.Create("movement.push_mass_cap", 1.75f, CVar.SERVER | CVar.REPLICATED);
+
+    /// <summary>
+    /// Is crawling enabled
+    /// </summary>
+    [CVarControl(AdminFlags.VarEdit)]
+    public static readonly CVarDef<bool> MovementCrawling =
+        CVarDef.Create("movement.crawling", true, CVar.SERVER | CVar.REPLICATED);
+
 }
index 1a7bc88ec325bd0c240f499c21cc07e68139305c..3ab4791269df6364841714cdc9239dc5316f8eaf 100644 (file)
@@ -1,5 +1,6 @@
-using Content.Shared.Alert;
+using Content.Shared.Alert;
 using Content.Shared.Buckle.Components;
+using Content.Shared.CCVar;
 using Content.Shared.Damage;
 using Content.Shared.Damage.Components;
 using Content.Shared.Database;
@@ -13,6 +14,7 @@ using Content.Shared.Popups;
 using Content.Shared.Rejuvenate;
 using Content.Shared.Standing;
 using Robust.Shared.Audio;
+using Robust.Shared.Configuration;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
@@ -33,6 +35,7 @@ public abstract partial class SharedStunSystem
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly SharedPhysicsSystem _physics = default!;
     [Dependency] private readonly StandingStateSystem _standingState = default!;
+    [Dependency] private readonly IConfigurationManager _cfgManager = default!;
 
     public static readonly ProtoId<AlertPrototype> KnockdownAlert = "Knockdown";
 
@@ -238,7 +241,7 @@ public abstract partial class SharedStunSystem
     private void ToggleKnockdown(Entity<CrawlerComponent?, KnockedDownComponent?> entity)
     {
         // We resolve here instead of using TryCrawling to be extra sure someone without crawler can't stand up early.
-        if (!Resolve(entity, ref entity.Comp1, false))
+        if (!Resolve(entity, ref entity.Comp1, false) || !_cfgManager.GetCVar(CCVars.MovementCrawling))
             return;
 
         if (!Resolve(entity, ref entity.Comp2, false))
@@ -263,7 +266,7 @@ public abstract partial class SharedStunSystem
         if (!KnockdownOver((entity, entity.Comp)))
             return false;
 
-        if (!_crawlerQuery.TryComp(entity, out var crawler))
+        if (!_crawlerQuery.TryComp(entity, out var crawler) || !_cfgManager.GetCVar(CCVars.MovementCrawling))
         {
             // If we can't crawl then just have us sit back up...
             // In case you're wondering, the KnockdownOverCheck, returns if we're able to move, so if next update is null.