mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 14:41:42 +00:00
Fix adding multiple entries for same server when using globalservers several times, patch by Tequila
This commit is contained in:
parent
61c8b878b8
commit
44fb8f49b6
1 changed files with 13 additions and 1 deletions
|
@ -2239,7 +2239,7 @@ CL_ServersResponsePacket
|
|||
===================
|
||||
*/
|
||||
void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extended ) {
|
||||
int i, count, total;
|
||||
int i, j, count, total;
|
||||
netadr_t addresses[MAX_SERVERSPERPACKET];
|
||||
int numservers;
|
||||
byte* buffptr;
|
||||
|
@ -2320,6 +2320,18 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
|
|||
// build net address
|
||||
serverInfo_t *server = &cls.globalServers[count];
|
||||
|
||||
// Tequila: It's possible to have sent many master server requests. Then
|
||||
// we may receive many times the same addresses from the master server.
|
||||
// We just avoid to add a server if it is still in the global servers list.
|
||||
for (j = 0; j < count; j++)
|
||||
{
|
||||
if (NET_CompareAdr(cls.globalServers[j].adr, addresses[i]))
|
||||
break;
|
||||
}
|
||||
|
||||
if (j < count)
|
||||
continue;
|
||||
|
||||
CL_InitServerInfo( server, &addresses[i] );
|
||||
// advance to next slot
|
||||
count++;
|
||||
|
|
Loading…
Reference in a new issue