diff options
author | Zack Middleton <zturtleman@gmail.com> | 2013-10-28 14:36:56 -0500 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-06-17 17:43:35 +0100 |
commit | c75966ccdc58be3cae4a6066c05b12d7b9e9fb39 (patch) | |
tree | ee493f20a8359a62204dafc247ffb6fc6431d507 /src/client/cl_main.c | |
parent | bfd5a88d22160a94dfc0df380e01ed8319283e62 (diff) |
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.
Diffstat (limited to 'src/client/cl_main.c')
-rw-r--r-- | src/client/cl_main.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 8dd127e0..d597e29a 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -2430,6 +2430,9 @@ void CL_InitServerInfo( serverInfo_t *server, netadr_t *address ) { server->game[0] = '\0'; server->gameType = 0; server->netType = 0; + server->punkbuster = 0; + server->g_humanplayers = 0; + server->g_needpass = 0; } /* @@ -3880,18 +3883,8 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) { // add this to the list cls.numlocalservers = i+1; - cls.localServers[i].adr = 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; - + CL_InitServerInfo( &cls.localServers[i], &from ); + Q_strncpyz( info, MSG_ReadString( msg ), MAX_INFO_STRING ); if (strlen(info)) { if (info[strlen(info)-1] != '\n') { |