Дермократия changed

This commit is contained in:
Jabak
2024-10-01 21:02:34 +03:00
parent 0225043fdd
commit 5765e21859

View File

@@ -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");
}
}