From bd067540f5670185624e100818936654516490a0 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Thu, 1 Jun 2017 18:39:23 -0500 Subject: [PATCH] Fix hitch when opening Team Arena find friend menu 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(). --- code/ui/ui_main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c index 4fbe6cb8..f0649328 100644 --- a/code/ui/ui_main.c +++ b/code/ui/ui_main.c @@ -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;