mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
More reverts..
This commit is contained in:
parent
3ee76bc5ff
commit
4bc0d176d3
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue