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 870f180..3a15737 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 3849138..584cfd7 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 5eed529..747a391 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 "