diff --git a/Content.Server/_Sunrise/RoundEndVote/RoundEndVoteSystem.cs b/Content.Server/_Sunrise/RoundEndVote/RoundEndVoteSystem.cs index 6bbae40d73d..9d3e5e4ea71 100644 --- a/Content.Server/_Sunrise/RoundEndVote/RoundEndVoteSystem.cs +++ b/Content.Server/_Sunrise/RoundEndVote/RoundEndVoteSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Voting; using Robust.Shared.Timing; using Robust.Shared.Configuration; +using Robust.Shared.Random; namespace Content.Server._Sunrise.RoundEndVote; @@ -14,6 +15,7 @@ public sealed class RoundEndVoteSystem : EntitySystem [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IVoteManager _voteManager = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private readonly IRobustRandom _random = default!; private TimeSpan? _voteStartTime; @@ -55,7 +57,9 @@ public void StartRoundEndVotes() if (_cfg.GetCVar(SunriseCCVars.RunMapVoteAfterRestart)) _voteManager.CreateStandardVote(null, StandardVoteType.Map); - if (_cfg.GetCVar(SunriseCCVars.RunPresetVoteAfterRestart)) + var presetVoteChance = _cfg.GetCVar(SunriseCCVars.ChancePresetVoteAfterRestart); + + if (_cfg.GetCVar(SunriseCCVars.RunPresetVoteAfterRestart) && _random.Prob(presetVoteChance)) _voteManager.CreateStandardVote(null, StandardVoteType.Preset); } } diff --git a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs index 96fc69268a6..0be5743b11b 100644 --- a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs +++ b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs @@ -275,6 +275,8 @@ public static readonly CVarDef public static readonly CVarDef RunPresetVoteAfterRestart = CVarDef.Create("vote.run_preset_vote_after_restart", false); + public static readonly CVarDef ChancePresetVoteAfterRestart = CVarDef.Create("vote.chance_preset_vote_after_restart", 0.5f); + public static readonly CVarDef VotingsDelay = CVarDef.Create("vote.votings_delay", 60); public static readonly CVarDef MapVotingCount = CVarDef.Create("vote.map_voting_count", 3);