From 10fbaa4c2d626a40870770f54f8e062403a96733 Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 7 Jan 2009 12:48:48 +0000 Subject: [PATCH] try to make it use the default value of a cvar if it is not defined (sentcvar) git-svn-id: svn://svn.icculus.org/nexuiz/trunk@5437 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/clientcommands.qc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/qcsrc/server/clientcommands.qc b/data/qcsrc/server/clientcommands.qc index 5e4f497d8..b436164c1 100644 --- a/data/qcsrc/server/clientcommands.qc +++ b/data/qcsrc/server/clientcommands.qc @@ -265,8 +265,18 @@ void SV_ParseClientCommand(string s) { stuffcmd(self,"menu_showteamselect\n"); } } else if(argv(0) == "reportcvar") { // old system + if(substring(argv(2), 0, 1) == "$") // undefined cvar: use the default value on the server then + { + s = strcat(substring(s, argv_start_index(0), argv_end_index(1)), " \"", cvar_defstring(argv(1)), "\""); + tokens = tokenize_sane(s); + } GetCvars(1); } else if(argv(0) == "sentcvar") { // new system + if(tokens == 2) // undefined cvar: use the default value on the server then + { + s = strcat(substring(s, argv_start_index(0), argv_end_index(1)), " \"", cvar_defstring(argv(1)), "\""); + tokens = tokenize_sane(s); + } GetCvars(1); } else if(argv(0) == "spectate") { if not(self.flags & FL_CLIENT) -- 2.39.2