From 859f555f75b1da8477862662bccadf8f1b1a2b91 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 6 Dec 2023 02:07:47 -0500 Subject: [PATCH] fixes deleteallthenghost --- .../Systems/DefaultContractSpawningSystem.cs | 10 +++++++++- Content.Shared/_Citadel/CitVars.cs | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Content.Shared/_Citadel/CitVars.cs diff --git a/Content.Server/_Citadel/Contracts/Systems/DefaultContractSpawningSystem.cs b/Content.Server/_Citadel/Contracts/Systems/DefaultContractSpawningSystem.cs index 82d264cecc..98b1588295 100644 --- a/Content.Server/_Citadel/Contracts/Systems/DefaultContractSpawningSystem.cs +++ b/Content.Server/_Citadel/Contracts/Systems/DefaultContractSpawningSystem.cs @@ -1,13 +1,18 @@ -using Content.Server._Citadel.Contracts.Components; +using Content.Shared._Citadel.CitVars; +using Content.Server._Citadel.Contracts.Components; using Content.Shared._Citadel.Contracts; +using Robust.Shared.Configuration; namespace Content.Server._Citadel.Contracts.Systems; // SHITCODESHITCODESHITCODESHITCODESHITCODE // Whoever touches this next, REPLACE IT. + +//we cri ; m; -bhijn public sealed class DefaultContractSpawningSystem : EntitySystem { [Dependency] private readonly ContractManagementSystem _contract = default!; + [Dependency] protected readonly IConfigurationManager ConfigManager = default!; public Dictionary Contracts = new () { @@ -17,6 +22,9 @@ public sealed class DefaultContractSpawningSystem : EntitySystem public override void Update(float frameTime) { + if (!ConfigManager.GetCVar(CitVars.CitDebugContractSpawning)) + return; + foreach (var (contract, ent) in Contracts) { if (Deleted(ent) || diff --git a/Content.Shared/_Citadel/CitVars.cs b/Content.Shared/_Citadel/CitVars.cs new file mode 100644 index 0000000000..f552e2ce5a --- /dev/null +++ b/Content.Shared/_Citadel/CitVars.cs @@ -0,0 +1,15 @@ +using Robust.Shared; +using Robust.Shared.Configuration; + +namespace Content.Shared._Citadel.CitVars +{ + [CVarDefs] + public sealed class CitVars : CVars + { + /// + /// Automatically spawns more contracts as contracts are cleared + /// + public static readonly CVarDef + CitDebugContractSpawning = CVarDef.Create("debug.citadel.contractspawning", false, CVar.ARCHIVE | CVar.SERVERONLY); + } +} \ No newline at end of file