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 station goal cvar #2714

Merged
merged 2 commits into from
Nov 7, 2024
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
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);
}
Loading