mirror of
https://github.com/nzp-team/quakec.git
synced 2024-12-03 01:12:58 +00:00
MENU: menu_coop.qc: fix too many refreshes
This commit is contained in:
parent
22ff9e5fd7
commit
cffc82e6d8
1 changed files with 8 additions and 11 deletions
|
@ -87,8 +87,7 @@ void() Menu_Coop_Browse_Refresh =
|
|||
refreshtime = time + 0.5;
|
||||
|
||||
resethostcachemasks();
|
||||
// TODO: figure out why this returns 0 servers
|
||||
// sethostcachemaskstring(0, gethostcacheindexforkey("gamedir"), cvar_string("game"), SLIST_TEST_EQUAL);
|
||||
sethostcachemaskstring(0, gethostcacheindexforkey("gamedir"), cvar_string("game"), SLIST_TEST_EQUAL);
|
||||
sethostcachesort(gethostcacheindexforkey("ping"), false);
|
||||
refreshhostcache(true);
|
||||
resorthostcache();
|
||||
|
@ -100,19 +99,19 @@ void() Menu_Coop_Browse_Refresh =
|
|||
void() Menu_Coop_Browse_Update =
|
||||
{
|
||||
static float refreshtime;
|
||||
static float initialized;
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
Menu_Coop_Browse_Refresh();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
if (refreshtime > time)
|
||||
return;
|
||||
|
||||
refreshtime = time + 0.5;
|
||||
|
||||
resethostcachemasks();
|
||||
// TODO: figure out why this returns 0 servers
|
||||
// sethostcachemaskstring(0, gethostcacheindexforkey("gamedir"), cvar_string("game"), SLIST_TEST_EQUAL);
|
||||
sethostcachesort(gethostcacheindexforkey("ping"), false);
|
||||
refreshhostcache(false);
|
||||
resorthostcache();
|
||||
|
||||
num_cached_servers = (int)gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
|
||||
};
|
||||
|
||||
|
@ -124,8 +123,6 @@ void() Menu_Coop_Browse =
|
|||
|
||||
Menu_DrawTitle("BROWSE SERVERS");
|
||||
|
||||
// refresh button
|
||||
|
||||
// draw server list
|
||||
sui_set_align([SUI_ALIGN_CENTER, SUI_ALIGN_CENTER]);
|
||||
static vector serverlist_scrollofs;
|
||||
|
|
Loading…
Reference in a new issue