1
0
Fork 0
forked from fte/fteqw

Q2-alike +set handling.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@747 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-07 02:45:03 +00:00
parent 2500f221c4
commit 36606e1216

View file

@ -1974,6 +1974,40 @@ int COM_CheckParm (char *parm)
return COM_CheckNextParm(parm, 0); return COM_CheckNextParm(parm, 0);
} }
/*
===============
COM_ParsePlusSets
Looks for +set blah blah on the commandline, and creates cvars so that engine
functions may use the cvar before anything's loaded.
This isn't really needed, but might make some thing nicer.
===============
*/
void COM_ParsePlusSets (void)
{
int i;
for (i=1 ; i<com_argc-2 ; i++)
{
if (!com_argv[i])
continue; // NEXTSTEP sometimes clears appkit vars.
if (!com_argv[i+1])
continue;
if (!com_argv[i+2])
continue;
if (*com_argv[i+1] == '-' || *com_argv[i+1] == '+')
continue; //erm
if (*com_argv[i+2] == '-' || *com_argv[i+2] == '+')
continue; //erm
if (!strcmp(com_argv[i], "+set"))
Cvar_Get(com_argv[i+1], com_argv[i+2], 0, "Cvars set on commandline");
else if (!strcmp(com_argv[i], "+seta"))
Cvar_Get(com_argv[i+1], com_argv[i+2], CVAR_ARCHIVE, "Cvars set on commandline");
i+=2;
}
}
/* /*
================ ================
COM_CheckRegistered COM_CheckRegistered