From 151845192a696f92d80c608c90cb2d4fb5410d57 Mon Sep 17 00:00:00 2001 From: black Date: Tue, 19 Jul 2005 21:04:36 +0000 Subject: [PATCH] Moved the $cvar parser to Cmd_TokenizeString. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5540 d7cf8633-e32d-0410-b094-e92efae38249 --- cmd.c | 23 +++++++++++++++++++++++ common.c | 21 --------------------- svvm_cmds.c | 2 ++ 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/cmd.c b/cmd.c index 870f1809..3a15737f 100644 --- 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; diff --git a/common.c b/common.c index 3849138c..584cfd79 100644 --- 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; } diff --git a/svvm_cmds.c b/svvm_cmds.c index 5eed529d..747a3919 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -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 " -- 2.39.2