Дермократия returned
This commit is contained in:
@@ -57,7 +57,7 @@ namespace Content.Server.Voting.Managers
|
||||
|
||||
var ghostVotePercentageRequirement = _cfg.GetCVar(CCVars.VoteRestartGhostPercentage);
|
||||
var ghostCount = 0;
|
||||
|
||||
|
||||
foreach (var player in _playerManager.Sessions)
|
||||
{
|
||||
_playerManager.UpdateState(player);
|
||||
@@ -291,12 +291,6 @@ namespace Content.Server.Voting.Managers
|
||||
if(!preset.ShowInVote)
|
||||
continue;
|
||||
|
||||
if(_playerManager.PlayerCount < (preset.MinPlayers ?? int.MinValue))
|
||||
continue;
|
||||
|
||||
if(_playerManager.PlayerCount > (preset.MaxPlayers ?? int.MaxValue))
|
||||
continue;
|
||||
|
||||
presets[preset.ID] = preset.ModeTitle;
|
||||
}
|
||||
return presets;
|
||||
|
||||
29
Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs
Normal file
29
Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.RoundEnd;
|
||||
using Content.Server.Voting.Managers;
|
||||
using Content.Shared.Voting;
|
||||
|
||||
|
||||
namespace Content.Server._Honk.RoundEndVote;
|
||||
|
||||
|
||||
public sealed class RoundEndVoteSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IVoteManager _voteManager = default!;
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<RoundEndSystemChangedEvent>(OnRoundEndSystemChange);
|
||||
}
|
||||
|
||||
private void OnRoundEndSystemChange(RoundEndSystemChangedEvent ev)
|
||||
{
|
||||
//Эта строка проверяет, не находится ли игра в состоянии "PreRoundLobby".
|
||||
if(_gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
|
||||
return;
|
||||
|
||||
_voteManager.CreateStandardVote(null, StandardVoteType.Preset);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user