]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Allow refreshserverlist() to also clear the list like net_slist command.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 10 Oct 2013 17:09:20 +0000 (17:09 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 12 Oct 2013 02:32:28 +0000 (04:32 +0200)
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
mvm_cmds.c

index 4885f2916c70641ca7488b9fedd016fa7e144551..ae51fb0202de0b1df8a43f92e74e1669354a7cc8 100644 (file)
@@ -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;
index 0e828304f72e4e3777840e47a35077ee2d2d403b..7c10da02c4fdf01db452328c0667b8be919ea16d 100644 (file)
@@ -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);
 }
 
 /*