Only auto update empty Team Arena internet server cache

Previously tested a mod cvar which may be wrong when multiple
mods are involved or config is reset. Let's check the server
cache's internet server count directly.
This commit is contained in:
Zack Middleton 2017-06-03 11:45:11 -05:00
parent 66fec1b059
commit 5592342b1b

View file

@ -5982,11 +5982,10 @@ static void UI_StartServerRefresh(qboolean full, qboolean force)
// This function is called with force=qfalse when server browser menu opens or net source changes. // This function is called with force=qfalse when server browser menu opens or net source changes.
// Automatically update local and favorite servers. // Automatically update local and favorite servers.
// Only update master server list the first time because the server info cache will be available after that. // Only auto update master server list if there is no server info cache.
if ( !force && ( ui_netSource.integer >= UIAS_GLOBAL1 && ui_netSource.integer <= UIAS_GLOBAL5 ) ) { if ( !force && ( ui_netSource.integer >= UIAS_GLOBAL1 && ui_netSource.integer <= UIAS_GLOBAL5 ) ) {
char *value = UI_Cvar_VariableString( va( "ui_lastServerRefresh_%i", ui_netSource.integer ) ); if ( trap_LAN_GetServerCount( UI_SourceForLAN() ) > 0 ) {
if ( value[0] != 0 ) { return; // have cached list
return; // should have cached list
} }
} }