From 3bc77e45d4fc4a12ec16810452937314f5ce85a5 Mon Sep 17 00:00:00 2001 From: lzk <124214523+lzk228@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:27:43 +0100 Subject: [PATCH] Add station goal cvar --- .../Corvax/StationGoal/StationGoalPaperSystem.cs | 7 +++++++ Content.Shared/Corvax/CCCVars/CCCVars.cs | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs b/Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs index 3cd9e9ce056..383c28bc261 100644 --- a/Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs +++ b/Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs @@ -3,10 +3,12 @@ using Content.Server.GameTicking.Events; using Content.Server.Station.Components; using Content.Server.Station.Systems; +using Content.Shared.Corvax.CCCVars; using Content.Shared.Fax.Components; using Content.Shared.GameTicking; using Content.Shared.Paper; using Robust.Server.Player; +using Robust.Shared.Configuration; using Robust.Shared.Prototypes; using Robust.Shared.Random; @@ -22,6 +24,8 @@ public sealed class StationGoalPaperSystem : EntitySystem [Dependency] private readonly FaxSystem _fax = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly StationSystem _station = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; + public override void Initialize() { @@ -31,6 +35,9 @@ public override void Initialize() private void OnRoundStarting(RoundStartingEvent ev) { + if (!_cfg.GetCVar(CCCVars.StationGoal)) + return; + var playerCount = _playerManager.PlayerCount; var query = EntityQueryEnumerator(); diff --git a/Content.Shared/Corvax/CCCVars/CCCVars.cs b/Content.Shared/Corvax/CCCVars/CCCVars.cs index 2808da945af..f9f281d55bd 100644 --- a/Content.Shared/Corvax/CCCVars/CCCVars.cs +++ b/Content.Shared/Corvax/CCCVars/CCCVars.cs @@ -77,4 +77,14 @@ public sealed class CCCVars /// public static readonly CVarDef PeacefulRoundEnd = CVarDef.Create("game.peaceful_end", true, CVar.SERVERONLY); + + /* + * Station Goal + */ + + /// + /// Send station goal on round start or not. + /// + public static readonly CVarDef StationGoal = + CVarDef.Create("game.station_goal", true, CVar.SERVERONLY); }