Skip to content

Commit

Permalink
ui: fixed uninitialized variables in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarquis committed Apr 28, 2020
1 parent 0820814 commit 8a7740c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/ui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6278,6 +6278,8 @@ static void UI_BuildServerDisplayList(qboolean force)
trap_Cvar_Update(&ui_browserShowEmptyOrFull);
if (ui_browserShowEmptyOrFull.integer)
{
clients = atoi(Info_ValueForKey(info, "clients"));

if (clients < maxClients && (
(!clients && ui_browserShowEmptyOrFull.integer == 2) ||
(clients && ui_browserShowEmptyOrFull.integer == 1)))
Expand Down Expand Up @@ -6553,10 +6555,11 @@ static void UI_BuildServerDisplayList(qboolean force)

// player count after removing incompatible/filtered out servers
clients = atoi(Info_ValueForKey(info, "clients"));
humans = atoi(Info_ValueForKey(info, "humans"));

if ((ui_serverBrowserSettings.integer & UI_BROWSER_ALLOW_HUMANS_COUNT) &&
strstr(Info_ValueForKey(info, "version"), PRODUCT_LABEL) != NULL)
{
humans = atoi(Info_ValueForKey(info, "humans"));
uiInfo.serverStatus.numPlayersOnServers += clients;
uiInfo.serverStatus.numHumansOnServers += humans;
}
Expand Down

0 comments on commit 8a7740c

Please sign in to comment.