CGameContext::SendVoteStatus: Hide the trick for 64 clients

as an implementation detail. This way the caller is synced with the upstream
and does not care about 64 players.
This commit is contained in:
Alexander Akulich 2021-02-07 17:46:58 +03:00
parent 688f11ef34
commit dfc75806c6

View file

@ -617,6 +617,14 @@ void CGameContext::SendVoteSet(int ClientID)
void CGameContext::SendVoteStatus(int ClientID, int Total, int Yes, int No)
{
if(ClientID == -1)
{
for(int i = 0; i < MAX_CLIENTS; ++i)
if(Server()->ClientIngame(i))
SendVoteStatus(i, Total, Yes, No);
return;
}
if(Total > VANILLA_MAX_CLIENTS && m_apPlayers[ClientID] && m_apPlayers[ClientID]->GetClientVersion() <= VERSION_DDRACE)
{
Yes = float(Yes) * VANILLA_MAX_CLIENTS / float(Total);
@ -981,9 +989,7 @@ void CGameContext::OnTick()
else if(m_VoteUpdate)
{
m_VoteUpdate = false;
for(int i = 0; i < MAX_CLIENTS; ++i)
if(Server()->ClientIngame(i))
SendVoteStatus(i, Total, Yes, No);
SendVoteStatus(-1, Total, Yes, No);
}
}
}