Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explosion.can_create_vacuum cvar #27548

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -23,5 +24,6 @@ private void SubscribeCvars()
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);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using Content.Server.Atmos.EntitySystems;
using Content.Shared.CCVar;
using Content.Shared.Damage;
using Content.Shared.Explosion;
Expand All @@ -16,7 +17,6 @@
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
using Content.Server.Atmos.EntitySystems;

namespace Content.Server.Explosion.EntitySystems;

Expand Down Expand Up @@ -490,7 +490,9 @@ public void DamageFloorTile(TileRef tileRef,
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;
Expand Down
10 changes: 9 additions & 1 deletion Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared.Maps;
using Robust.Shared;
using Robust.Shared.Configuration;

Expand Down Expand Up @@ -905,6 +906,13 @@ public static readonly CVarDef<bool>
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
*/
Expand Down Expand Up @@ -1994,7 +2002,7 @@ public static readonly CVarDef<float>
// Clippy!
public static readonly CVarDef<string> TippyEntity =
CVarDef.Create("tippy.entity", "Tippy", CVar.SERVER | CVar.REPLICATED);

/*
* DEBUG
*/
Expand Down
Loading