]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
hide private cvars from the output of cvar name and cvarlist commands to prevent...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 Nov 2009 21:12:19 +0000 (21:12 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 Nov 2009 21:12:19 +0000 (21:12 +0000)
tab completion still shows their value because that cannot be triggered by CSQC code

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9421 d7cf8633-e32d-0410-b094-e92efae38249

cvar.c

diff --git a/cvar.c b/cvar.c
index 822f6e5e6266a0920743fe09d5434bbedd4ba26d..afdbcf057cedde987ee1767d36c4a93242bd2574 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -563,7 +563,7 @@ qboolean    Cvar_Command (void)
 // perform a variable print or set
        if (Cmd_Argc() == 1)
        {
-               Con_Printf("\"%s\" is \"%s\" [\"%s\"]\n", v->name, v->string, v->defstring);
+               Con_Printf("\"%s\" is \"%s\" [\"%s\"]\n", v->name, ((v->flags & CVAR_PRIVATE) ? "********" : v->string), v->defstring);
                return true;
        }
 
@@ -695,7 +695,7 @@ void Cvar_List_f (void)
                if (len && (ispattern ? !matchpattern_with_separator(cvar->name, partial, false, "", false) : strncmp (partial,cvar->name,len)))
                        continue;
 
-               Con_Printf("%s is \"%s\" [\"%s\"] %s\n", cvar->name, cvar->string, cvar->defstring, cvar->description);
+               Con_Printf("%s is \"%s\" [\"%s\"] %s\n", cvar->name, ((cvar->flags & CVAR_PRIVATE) ? "********" : cvar->string), cvar->defstring, cvar->description);
                count++;
        }