mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
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:
parent
688f11ef34
commit
dfc75806c6
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue