More reverts..

This commit is contained in:
def 2018-01-13 22:22:55 +01:00
parent 3ee76bc5ff
commit 4bc0d176d3

View file

@ -766,7 +766,9 @@ void CGameContext::OnTick()
(m_VoteKick || m_VoteSpec))
Total = g_Config.m_SvVoteMaxTotal;
if(No >= Total - Total / (100.0 / g_Config.m_SvVoteYesPercentage))
if((Yes > Total / (100.0 / g_Config.m_SvVoteYesPercentage)) && !Veto)
m_VoteEnforce = VOTE_ENFORCE_YES;
else if(No >= Total - Total / (100.0 / g_Config.m_SvVoteYesPercentage))
m_VoteEnforce = VOTE_ENFORCE_NO;
if(VetoStop)
@ -780,14 +782,32 @@ void CGameContext::OnTick()
if(m_VoteEnforce == VOTE_ENFORCE_YES)
{
Server()->SetRconCID(IServer::RCON_CID_VOTE);
Console()->ExecuteLine(m_aVoteCommand);
Server()->SetRconCID(IServer::RCON_CID_SERV);
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote passed");
if (PlayerModerating() && (m_VoteKick || m_VoteSpec))
{
// Ensure minimum time for vote to end when moderating.
if (time_get() > m_VoteCloseTime)
{
Server()->SetRconCID(IServer::RCON_CID_VOTE);
Console()->ExecuteLine(m_aVoteCommand);
Server()->SetRconCID(IServer::RCON_CID_SERV);
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote passed");
if (m_apPlayers[m_VoteCreator] && !m_VoteKick && !m_VoteSpec)
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
if (m_apPlayers[m_VoteCreator] && !m_VoteKick && !m_VoteSpec)
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
}
}
else
{
Server()->SetRconCID(IServer::RCON_CID_VOTE);
Console()->ExecuteLine(m_aVoteCommand);
Server()->SetRconCID(IServer::RCON_CID_SERV);
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote passed");
if (m_apPlayers[m_VoteCreator] && !m_VoteKick && !m_VoteSpec)
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
}
}
else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN)
{