Add explosion.can_create_vacuum cvar (#27548)
This commit is contained in:
@@ -12,6 +12,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
|||||||
public bool SleepNodeSys { get; private set; }
|
public bool SleepNodeSys { get; private set; }
|
||||||
public bool IncrementalTileBreaking { 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()
|
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.ExplosionMaxProcessingTime, value => MaxProcessingTime = value, true);
|
||||||
Subs.CVar(_cfg, CCVars.ExplosionIncrementalTileBreaking, value => IncrementalTileBreaking = value, true);
|
Subs.CVar(_cfg, CCVars.ExplosionIncrementalTileBreaking, value => IncrementalTileBreaking = value, true);
|
||||||
Subs.CVar(_cfg, CCVars.ExplosionSingleTickAreaLimit, value => SingleTickAreaLimit = value, true);
|
Subs.CVar(_cfg, CCVars.ExplosionSingleTickAreaLimit, value => SingleTickAreaLimit = value, true);
|
||||||
|
Subs.CVar(_cfg, CCVars.ExplosionCanCreateVacuum, value => CanCreateVacuum = value, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using Content.Server.Atmos.EntitySystems;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Explosion;
|
using Content.Shared.Explosion;
|
||||||
@@ -16,7 +17,6 @@ using Robust.Shared.Random;
|
|||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
|
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
|
||||||
using Content.Server.Atmos.EntitySystems;
|
|
||||||
|
|
||||||
namespace Content.Server.Explosion.EntitySystems;
|
namespace Content.Server.Explosion.EntitySystems;
|
||||||
|
|
||||||
@@ -490,7 +490,9 @@ public sealed partial class ExplosionSystem
|
|||||||
if (_tileDefinitionManager[tileRef.Tile.TypeId] is not ContentTileDefinition tileDef)
|
if (_tileDefinitionManager[tileRef.Tile.TypeId] is not ContentTileDefinition tileDef)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tileDef.MapAtmosphere)
|
if (!CanCreateVacuum)
|
||||||
|
canCreateVacuum = false;
|
||||||
|
else if (tileDef.MapAtmosphere)
|
||||||
canCreateVacuum = true; // is already a vacuum.
|
canCreateVacuum = true; // is already a vacuum.
|
||||||
|
|
||||||
int tileBreakages = 0;
|
int tileBreakages = 0;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Content.Shared.Maps;
|
||||||
using Robust.Shared;
|
using Robust.Shared;
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
|
|
||||||
@@ -905,6 +906,13 @@ namespace Content.Shared.CCVar
|
|||||||
public static readonly CVarDef<int> ExplosionSingleTickAreaLimit =
|
public static readonly CVarDef<int> ExplosionSingleTickAreaLimit =
|
||||||
CVarDef.Create("explosion.single_tick_area_limit", 400, CVar.SERVERONLY);
|
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
|
* Radiation
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user