]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add explosion.can_create_vacuum cvar (#27548)
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Wed, 1 May 2024 03:11:27 +0000 (20:11 -0700)
committerGitHub <noreply@github.com>
Wed, 1 May 2024 03:11:27 +0000 (13:11 +1000)
Content.Server/Explosion/EntitySystems/ExplosionSystem.CVars.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs
Content.Shared/CCVar/CCVars.cs

index 1f031093333f4d0cee6e78c92bc7ef5b114d232f..3332d3a4f59ca5c903af8132718cc6e9552329a2 100644 (file)
@@ -11,7 +11,8 @@ public sealed partial class ExplosionSystem : EntitySystem
     public int ThrowLimit { get; private set; }
     public bool SleepNodeSys { get; private set; }
     public bool IncrementalTileBreaking { get; private set; }
-    public int SingleTickAreaLimit {get; private set; }
+    public int SingleTickAreaLimit { get; private set; }
+    public bool CanCreateVacuum { get; private set; }
 
     private void SubscribeCvars()
     {
@@ -23,5 +24,6 @@ public sealed partial class ExplosionSystem : EntitySystem
         Subs.CVar(_cfg, CCVars.ExplosionMaxProcessingTime, value => MaxProcessingTime = value, true);
         Subs.CVar(_cfg, CCVars.ExplosionIncrementalTileBreaking, value => IncrementalTileBreaking = value, true);
         Subs.CVar(_cfg, CCVars.ExplosionSingleTickAreaLimit, value => SingleTickAreaLimit = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionCanCreateVacuum, value => CanCreateVacuum = value, true);
     }
 }
index 6e100fe656eb5e68504eec8a9d43881aee3b7985..a93157a175372d7afe2e9827f5b28efc538eb69d 100644 (file)
@@ -1,4 +1,5 @@
 using System.Numerics;
+using Content.Server.Atmos.EntitySystems;
 using Content.Shared.CCVar;
 using Content.Shared.Damage;
 using Content.Shared.Explosion;
@@ -16,7 +17,6 @@ using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
-using Content.Server.Atmos.EntitySystems;
 
 namespace Content.Server.Explosion.EntitySystems;
 
@@ -490,7 +490,9 @@ public sealed partial class ExplosionSystem
         if (_tileDefinitionManager[tileRef.Tile.TypeId] is not ContentTileDefinition tileDef)
             return;
 
-        if (tileDef.MapAtmosphere)
+        if (!CanCreateVacuum)
+            canCreateVacuum = false;
+        else if (tileDef.MapAtmosphere)
             canCreateVacuum = true; // is already a vacuum.
 
         int tileBreakages = 0;
index cbc035140f535401d2e9d46d054db9348820fb16..36de8857fb146347d3b9a55acc000463b50bbf0b 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Maps;
 using Robust.Shared;
 using Robust.Shared.Configuration;
 
@@ -905,6 +906,13 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<int> ExplosionSingleTickAreaLimit =
             CVarDef.Create("explosion.single_tick_area_limit", 400, CVar.SERVERONLY);
 
+        /// <summary>
+        ///     Whether or not explosions are allowed to create tiles that have
+        ///     <see cref="ContentTileDefinition.MapAtmosphere"/> set to true.
+        /// </summary>
+        public static readonly CVarDef<bool> ExplosionCanCreateVacuum =
+            CVarDef.Create("explosion.can_create_vacuum", true, CVar.SERVERONLY);
+
         /*
          * Radiation
          */
@@ -1994,7 +2002,7 @@ namespace Content.Shared.CCVar
         // Clippy!
         public static readonly CVarDef<string> TippyEntity =
             CVarDef.Create("tippy.entity", "Tippy", CVar.SERVER | CVar.REPLICATED);
-            
+
         /*
          * DEBUG
          */