diff --git a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs index e1bffa769d..3800d7f02c 100644 --- a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs +++ b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs @@ -81,10 +81,18 @@ namespace Content.Server.Voting.Managers var ratioRequired = _cfg.GetCVar(CCVars.VoteRestartRequiredRatio); if (total > 0 && votesYes / (float) total >= ratioRequired) { - _adminLogger.Add(LogType.Vote, LogImpact.Medium, $"Restart vote succeeded: {votesYes}/{votesNo}"); - _chatManager.DispatchServerAnnouncement(Loc.GetString("ui-vote-restart-succeeded")); - var roundEnd = _entityManager.EntitySysManager.GetEntitySystem(); - roundEnd.EndRound(); + // Check if an admin is online, and ignore the passed vote if the cvar is enabled + if (_cfg.GetCVar(CCVars.VoteRestartNotAllowedWhenAdminOnline) && _adminMgr.ActiveAdmins.Count() != 0) + { + _adminLogger.Add(LogType.Vote, LogImpact.Medium, $"Restart vote attempted to pass, but an admin was online. {votesYes}/{votesNo}"); + } + else // If the cvar is disabled or there's no admins on, proceed as normal + { + _adminLogger.Add(LogType.Vote, LogImpact.Medium, $"Restart vote succeeded: {votesYes}/{votesNo}"); + _chatManager.DispatchServerAnnouncement(Loc.GetString("ui-vote-restart-succeeded")); + var roundEnd = _entityManager.EntitySysManager.GetEntitySystem(); + roundEnd.EndRound(); + } } else { diff --git a/Content.Server/Voting/Managers/VoteManager.cs b/Content.Server/Voting/Managers/VoteManager.cs index 4fb022fad0..d57d3e74ff 100644 --- a/Content.Server/Voting/Managers/VoteManager.cs +++ b/Content.Server/Voting/Managers/VoteManager.cs @@ -338,10 +338,6 @@ namespace Content.Server.Voting.Managers if (voteType != null && _standardVoteTimeout.TryGetValue(voteType.Value, out timeSpan)) return false; - // No, seriously, stop spamming the restart vote! - if (voteType == StandardVoteType.Restart && _cfg.GetCVar(CCVars.VoteRestartNotAllowedWhenAdminOnline) && _adminMgr.ActiveAdmins.Count() != 0) - return false; - // If only one Preset available thats not really a vote // Still allow vote if availbable one is different from current one if (voteType == StandardVoteType.Preset) diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index fb6626c150..b18ab14262 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -1223,7 +1223,7 @@ namespace Content.Shared.CCVar CVarDef.Create("vote.restart_required_ratio", 0.85f, CVar.SERVERONLY); /// - /// Whether or not to restrict the restart vote when there's online admins. + /// Whether or not to prevent the restart vote from having any effect when there is an online admin /// public static readonly CVarDef VoteRestartNotAllowedWhenAdminOnline = CVarDef.Create("vote.restart_not_allowed_when_admin_online", true, CVar.SERVERONLY);