Skip to content

Commit

Permalink
Add station goal cvar
Browse files Browse the repository at this point in the history
  • Loading branch information
lzk228 committed Oct 29, 2024
1 parent a0c621a commit 3bc77e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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()
{
Expand All @@ -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<StationGoalComponent>();
Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/Corvax/CCCVars/CCCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,14 @@ public sealed class CCCVars
/// </summary>
public static readonly CVarDef<bool> PeacefulRoundEnd =
CVarDef.Create("game.peaceful_end", true, CVar.SERVERONLY);

/*
* Station Goal
*/

/// <summary>
/// Send station goal on round start or not.
/// </summary>
public static readonly CVarDef<bool> StationGoal =
CVarDef.Create("game.station_goal", true, CVar.SERVERONLY);
}

0 comments on commit 3bc77e4

Please sign in to comment.