mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +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)
|
||||
|
@ -779,6 +781,11 @@ void CGameContext::OnTick()
|
|||
m_VoteEnforce = (m_VoteWillPass && !Veto) ? VOTE_ENFORCE_YES : VOTE_ENFORCE_NO;
|
||||
|
||||
if(m_VoteEnforce == VOTE_ENFORCE_YES)
|
||||
{
|
||||
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);
|
||||
|
@ -789,6 +796,19 @@ void CGameContext::OnTick()
|
|||
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)
|
||||
{
|
||||
char aBuf[64];
|
||||
|
|
Loading…
Reference in a new issue