diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c index 21cd6f03..d2370f6c 100644 --- a/code/ui/ui_main.c +++ b/code/ui/ui_main.c @@ -3781,6 +3781,12 @@ static void UI_BuildServerDisplayList(int force) { // get the ping for this server ping = trap_LAN_GetServerPing(lanSource, i); if (ping > 0 || ui_netSource.integer == UIAS_FAVORITES) { + // Remove favorite servers so they do not appear multiple times + // or appear when the cached server info was not filtered out + // but the new server info is filtered out. + if (ui_netSource.integer == UIAS_FAVORITES) { + UI_RemoveServerFromDisplayList(i); + } trap_LAN_GetServerInfo(lanSource, i, info, MAX_STRING_CHARS); @@ -3789,7 +3795,9 @@ static void UI_BuildServerDisplayList(int force) { if (ui_browserShowEmpty.integer == 0) { if (clients == 0) { - trap_LAN_MarkServerVisible(lanSource, i, qfalse); + if (ping > 0) { + trap_LAN_MarkServerVisible(lanSource, i, qfalse); + } continue; } } @@ -3797,7 +3805,9 @@ static void UI_BuildServerDisplayList(int force) { if (ui_browserShowFull.integer == 0) { maxClients = atoi(Info_ValueForKey(info, "sv_maxclients")); if (clients == maxClients) { - trap_LAN_MarkServerVisible(lanSource, i, qfalse); + if (ping > 0) { + trap_LAN_MarkServerVisible(lanSource, i, qfalse); + } continue; } } @@ -3805,21 +3815,21 @@ static void UI_BuildServerDisplayList(int force) { if (uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum != -1) { game = atoi(Info_ValueForKey(info, "gametype")); if (game != uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum) { - trap_LAN_MarkServerVisible(lanSource, i, qfalse); + if (ping > 0) { + trap_LAN_MarkServerVisible(lanSource, i, qfalse); + } continue; } } if (ui_serverFilterType.integer > 0) { if (Q_stricmp(Info_ValueForKey(info, "game"), serverFilters[ui_serverFilterType.integer].basedir) != 0) { - trap_LAN_MarkServerVisible(lanSource, i, qfalse); + if (ping > 0) { + trap_LAN_MarkServerVisible(lanSource, i, qfalse); + } continue; } } - // make sure we never add a favorite server twice - if (ui_netSource.integer == UIAS_FAVORITES) { - UI_RemoveServerFromDisplayList(i); - } // insert the server into the list UI_BinaryServerInsertion(i); // done with this server