From: divverent Date: Thu, 10 Oct 2013 17:09:20 +0000 (+0000) Subject: Allow refreshserverlist() to also clear the list like net_slist command. X-Git-Tag: xonotic-v0.8.0~96^2~20 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=686d46cd465ae8ea163d242384a4f9e2bba10e46;p=xonotic%2Fdarkplaces.git Allow refreshserverlist() to also clear the list like net_slist command. Usage: refreshserverlist(TRUE); git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12020 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/dpdefs/menudefs.qc b/dpdefs/menudefs.qc index 4885f291..ae51fb02 100644 --- a/dpdefs/menudefs.qc +++ b/dpdefs/menudefs.qc @@ -562,7 +562,7 @@ void sethostcachemaskstring(float mask, float fld, string str, float op) = #616 void sethostcachemasknumber(float mask, float fld, float num, float op) = #617; void resorthostcache(void) = #618; void sethostcachesort(float fld, float descending) = #619; -void refreshhostcache(void) = #620; +void refreshhostcache(...) = #620; // optional boolean argument "clear_list" float gethostcachenumber(float fld, float hostnr) = #621; float gethostcacheindexforkey(string key) = #622; void addwantedhostcachekey(string key) = #623; diff --git a/mvm_cmds.c b/mvm_cmds.c index 0e828304..7c10da02 100644 --- a/mvm_cmds.c +++ b/mvm_cmds.c @@ -576,8 +576,11 @@ refreshserverlist() */ static void VM_M_refreshserverlist(prvm_prog_t *prog) { - VM_SAFEPARMCOUNT( 0, VM_M_refreshserverlist ); - ServerList_QueryList(false, true, false, false); + qboolean do_reset = false; + VM_SAFEPARMCOUNTRANGE( 0, 1, VM_M_refreshserverlist ); + if (prog->argc >= 1 && PRVM_G_FLOAT(OFS_PARM0)) + do_reset = true; + ServerList_QueryList(do_reset, true, false, false); } /*