From 5765e218592ea9bb2ffed15e6d9ab56e3b9192dd Mon Sep 17 00:00:00 2001 From: Jabak <163307958+Jabaks@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:02:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B5=D1=80=D0=BC=D0=BE=D0=BA=D1=80?= =?UTF-8?q?=D0=B0=D1=82=D0=B8=D1=8F=20changed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Honk/RoundEndVote/RoundEndVoteSystem.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs b/Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs index 2633c8e58f..14e1b64ebc 100644 --- a/Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs +++ b/Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs @@ -2,6 +2,7 @@ using Content.Server.RoundEnd; using Content.Server.Voting.Managers; using Content.Shared.Voting; +using Robust.Server.Player; namespace Content.Server._Honk.RoundEndVote; @@ -11,6 +12,7 @@ public sealed class RoundEndVoteSystem : EntitySystem { [Dependency] private readonly IVoteManager _voteManager = default!; [Dependency] private readonly GameTicker _gameTicker = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; public override void Initialize() { @@ -19,12 +21,19 @@ public sealed class RoundEndVoteSystem : EntitySystem private void OnRoundEndSystemChange(RoundEndSystemChangedEvent ev) { - //Эта строка проверяет, не находится ли игра в состоянии "PreRoundLobby". if(_gameTicker.RunLevel != GameRunLevel.PreRoundLobby) return; - _voteManager.CreateStandardVote(null, StandardVoteType.Preset); + var player = _playerManager.PlayerCount; + + if (player >= 20) + { + _voteManager.CreateStandardVote(null, StandardVoteType.Preset); + } + _voteManager.CreateStandardVote(null, StandardVoteType.Map); + + _gameTicker.SetGamePreset("Secret"); } }