Fix combined player/ping sorting function

This commit is contained in:
trml 2020-10-24 01:17:03 +02:00
parent f74c3e5776
commit 6fc1316d63

View file

@ -170,10 +170,10 @@ bool CServerBrowser::SortCompareNumPlayersAndPing(int Index1, int Index2) const
if(a->m_Info.m_NumFilteredPlayers == b->m_Info.m_NumFilteredPlayers)
return a->m_Info.m_Latency > b->m_Info.m_Latency;
if(a->m_Info.m_NumFilteredPlayers == 0 || b->m_Info.m_NumFilteredPlayers == 0)
return a->m_Info.m_NumFilteredPlayers == 0;
else if(a->m_Info.m_NumFilteredPlayers == 0 || b->m_Info.m_NumFilteredPlayers == 0 || a->m_Info.m_Latency / 100 == b->m_Info.m_Latency / 100)
return a->m_Info.m_NumFilteredPlayers < b->m_Info.m_NumFilteredPlayers;
else
return a->m_Info.m_NumFilteredPlayers - (a->m_Info.m_Latency / 100) * MAX_CLIENTS < b->m_Info.m_NumFilteredPlayers - (b->m_Info.m_Latency / 100) * MAX_CLIENTS;
return a->m_Info.m_Latency > b->m_Info.m_Latency;
}
void CServerBrowser::Filter()