From c53528b92fe05ed87bfc509aa20d41a90a3aee44 Mon Sep 17 00:00:00 2001 From: def Date: Fri, 19 Jun 2020 23:58:46 +0200 Subject: [PATCH] Allow spectators to start votes --- src/engine/shared/config_variables.h | 1 - src/game/server/gamecontext.cpp | 12 +----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index e7f9513fc..29e8a48ec 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -200,7 +200,6 @@ MACRO_CONFIG_INT(SvVoteYesPercentage, sv_vote_yes_percentage, 50, 1, 100, CFGFLA MACRO_CONFIG_INT(SvVoteMajority, sv_vote_majority, 0, 0, 1, CFGFLAG_SERVER, "Whether No. of Yes is compared to No. of No votes or to number of total Players ( Default is 0 Y compare N)") MACRO_CONFIG_INT(SvVoteMaxTotal, sv_vote_max_total, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "How many people can participate in a vote at max (0 = no limit by default)") MACRO_CONFIG_INT(SvVoteVetoTime, sv_vote_veto_time, 20, 0, 1000, CFGFLAG_SERVER, "Minutes of time on a server until a player can veto map change votes (0 = disabled)") -MACRO_CONFIG_INT(SvSpectatorVotes, sv_spectator_votes, 1, 0, 1, CFGFLAG_SERVER, "Choose if spectators are allowed to start votes") MACRO_CONFIG_INT(SvKillDelay, sv_kill_delay, 1, 0, 9999, CFGFLAG_SERVER, "The minimum time in seconds between kills") MACRO_CONFIG_INT(SvSuicidePenalty, sv_suicide_penalty, 0, 0, 9999, CFGFLAG_SERVER, "The minimum time in seconds between kill or /kills and respawn") diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index cec120998..7e7cd2fbd 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -749,11 +749,7 @@ void CGameContext::OnTick() int64 Now = Server()->Tick(); for(int i = 0; i < MAX_CLIENTS; i++) { - //if(!m_apPlayers[i] || m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS || aVoteChecked[i]) // don't count in votes by spectators - if(!m_apPlayers[i] || - (g_Config.m_SvSpectatorVotes == 0 && - m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS) || - aVoteChecked[i]) // don't count in votes by spectators if the admin doesn't want it + if(!m_apPlayers[i] || aVoteChecked[i]) continue; if((m_VoteKick || m_VoteSpec) && (m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS || @@ -3766,12 +3762,6 @@ bool CGameContext::RateLimitPlayerVote(int ClientID) return true; pPlayer->m_LastVoteTry = Now; - if(g_Config.m_SvSpectatorVotes == 0 && pPlayer->GetTeam() == TEAM_SPECTATORS) - { - SendChatTarget(ClientID, "Spectators aren't allowed to start a vote."); - return true; - } - if(m_VoteCloseTime) { SendChatTarget(ClientID, "Wait for current vote to end before calling a new one.");