Skip to content

Commit

Permalink
Fix hitch when opening Team Arena find friend menu
Browse files Browse the repository at this point in the history
Opening the find friend menu in the Team Arena server browser
hitches due to trying to resolve blank host names.

In UI_BuildFindPlayerList() status requests that are initial or
completed state or have timed out get reset. This means it starts
with MAX_SERVERSTATUSREQUESTS (16) blank host names. So just ignore
them in UI_GetServerStatusInfo().
  • Loading branch information
zturtleman committed Jun 1, 2017
1 parent 0a19ae0 commit bd06754
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion code/ui/ui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3920,11 +3920,21 @@ static int UI_GetServerStatusInfo( const char *serverAddress, serverStatusInfo_t
char *p, *score, *ping, *name;
int i, len;

if (info) {
memset(info, 0, sizeof(*info));
}

// ignore initial unset addresses
if (serverAddress && *serverAddress == '\0') {
return qfalse;
}

// reset server status request for this address
if (!info) {
trap_LAN_ServerStatus( serverAddress, NULL, 0);
return qfalse;
}
memset(info, 0, sizeof(*info));

if ( trap_LAN_ServerStatus( serverAddress, info->text, sizeof(info->text)) ) {
Q_strncpyz(info->address, serverAddress, sizeof(info->address));
p = info->text;
Expand Down

0 comments on commit bd06754

Please sign in to comment.