]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Moved the $cvar parser to Cmd_TokenizeString.
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 19 Jul 2005 21:04:36 +0000 (21:04 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 19 Jul 2005 21:04:36 +0000 (21:04 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5540 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c
common.c
svvm_cmds.c

diff --git a/cmd.c b/cmd.c
index 870f18090b99ffca8fbbbefb53e22e363e381f0c..3a15737f0dbdc05baf1d67e55d4099238e174b86 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -598,6 +598,29 @@ static void Cmd_TokenizeString (const char *text)
                if (!COM_ParseTokenConsole(&text))
                        return;
 
+               // check for $cvar 
+               // (perhaps use another target buffer?)
+               if (com_token[0] == '$' && com_token[1]) 
+               {
+                       cvar_t *cvar;
+
+                       cvar = Cvar_FindVar(&com_token[1]);
+                       if (cvar)
+                       {
+                               strcpy(com_token, cvar->string);
+                       }
+                       else if( com_token[1] == '$' )
+                       {
+                               // remove the first $
+                               char *pos;
+                       
+                               for( pos = com_token ; *pos ; pos++ )
+                               {
+                                       *pos = *(pos + 1);
+                               }
+                       }
+               }
+
                if (cmd_argc < MAX_ARGS)
                {
                        l = (int)strlen(com_token) + 1;
index 3849138cf84d61093ee7d6c3ebc58259f125ca63..584cfd790b577c0b5b6f4cab23a8056d11ac8d8c 100644 (file)
--- a/common.c
+++ b/common.c
@@ -801,27 +801,6 @@ skipwhite:
                *datapointer = data;
        }
 
-       // check for $cvar
-       if (com_token[0] == '$' && com_token[1]) 
-       {
-               cvar_t *cvar;
-
-               cvar = Cvar_FindVar(&com_token[1]);
-               if (cvar)
-               {
-                       strcpy(com_token, cvar->string);
-               }
-               else if( com_token[1] == '$' )
-               {
-                       // remove the first $
-                       char *pos;
-               
-                       for( pos = com_token ; *pos ; pos++ )
-                       {
-                               *pos = *(pos + 1);
-                       }
-               }
-       }
        return true;
 }
 
index 5eed529dd6a92be80f7146a3a18603364c21e64f..747a39199c2e77eafedc5464538f0efaad8fd600 100644 (file)
@@ -8,6 +8,8 @@ cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2"}; //"0.93"}; // LordHavoc: disabled au
 
 
 char *vm_sv_extensions =
+"DP_CON_EXPANDCVAR "
+"DP_CON_ALIASPARAMETERS "
 "DP_BUTTONCHAT "
 "DP_BUTTONUSE "
 "DP_CL_LOADSKY "