mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Only sort players on last packet
This commit is contained in:
parent
d158267e92
commit
a0e5c6759d
|
@ -1093,7 +1093,7 @@ void CClient::ProcessConnlessPacket(CNetChunk *pPacket)
|
|||
|
||||
int Offset = Up.GetInt();
|
||||
|
||||
for(int i = max(Offset, 0); i < Offset + 24 && i < MAX_CLIENTS; i++)
|
||||
for(int i = max(Offset, 0); i < max(Offset, 0) + 24 && i < MAX_CLIENTS; i++)
|
||||
{
|
||||
str_copy(Info.m_aClients[i].m_aName, Up.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), sizeof(Info.m_aClients[i].m_aName));
|
||||
str_copy(Info.m_aClients[i].m_aClan, Up.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), sizeof(Info.m_aClients[i].m_aClan));
|
||||
|
@ -1105,7 +1105,8 @@ void CClient::ProcessConnlessPacket(CNetChunk *pPacket)
|
|||
if(!Up.Error())
|
||||
{
|
||||
// sort players
|
||||
qsort(Info.m_aClients, Info.m_NumClients, sizeof(*Info.m_aClients), PlayerScoreComp);
|
||||
if (Offset + 24 >= Info.m_NumClients)
|
||||
qsort(Info.m_aClients, Info.m_NumClients, sizeof(*Info.m_aClients), PlayerScoreComp);
|
||||
|
||||
if(net_addr_comp(&m_ServerAddress, &pPacket->m_Address) == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue