From f5be383dee6805d62672198c4c587869b3ebeb66 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 10 Oct 2013 17:09:20 +0000 Subject: [PATCH] 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 ::stable-branch::merge=686d46cd465ae8ea163d242384a4f9e2bba10e46 --- dpdefs/menudefs.qc | 2 +- mvm_cmds.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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); } /* -- 2.39.2