Clear more variables in CL_InitServerInfo
Have cls.localServers use CL_InitServerInfo. Don't set cls.localServers netType to from.type, it's the wrong value. Note: server->visible is not cleared in CL_InitServerInfo, as stated by a comment below a place where CL_InitServerInfo is used.
This commit is contained in:
parent
535d0ea70e
commit
e0a42885d9
1 changed files with 5 additions and 15 deletions
|
@ -2429,6 +2429,9 @@ void CL_InitServerInfo( serverInfo_t *server, netadr_t *address ) {
|
||||||
server->game[0] = '\0';
|
server->game[0] = '\0';
|
||||||
server->gameType = 0;
|
server->gameType = 0;
|
||||||
server->netType = 0;
|
server->netType = 0;
|
||||||
|
server->punkbuster = 0;
|
||||||
|
server->g_humanplayers = 0;
|
||||||
|
server->g_needpass = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_SERVERSPERPACKET 256
|
#define MAX_SERVERSPERPACKET 256
|
||||||
|
@ -3836,20 +3839,7 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
|
||||||
|
|
||||||
// add this to the list
|
// add this to the list
|
||||||
cls.numlocalservers = i+1;
|
cls.numlocalservers = i+1;
|
||||||
cls.localServers[i].adr = from;
|
CL_InitServerInfo( &cls.localServers[i], &from );
|
||||||
cls.localServers[i].clients = 0;
|
|
||||||
cls.localServers[i].hostName[0] = '\0';
|
|
||||||
cls.localServers[i].mapName[0] = '\0';
|
|
||||||
cls.localServers[i].maxClients = 0;
|
|
||||||
cls.localServers[i].maxPing = 0;
|
|
||||||
cls.localServers[i].minPing = 0;
|
|
||||||
cls.localServers[i].ping = -1;
|
|
||||||
cls.localServers[i].game[0] = '\0';
|
|
||||||
cls.localServers[i].gameType = 0;
|
|
||||||
cls.localServers[i].netType = from.type;
|
|
||||||
cls.localServers[i].punkbuster = 0;
|
|
||||||
cls.localServers[i].g_humanplayers = 0;
|
|
||||||
cls.localServers[i].g_needpass = 0;
|
|
||||||
|
|
||||||
Q_strncpyz( info, MSG_ReadString( msg ), MAX_INFO_STRING );
|
Q_strncpyz( info, MSG_ReadString( msg ), MAX_INFO_STRING );
|
||||||
if (strlen(info)) {
|
if (strlen(info)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue