Fix bug where Com_StartupVariable would set CVAR_USER_CREATED on already existing cvars

This commit is contained in:
Thilo Schulz 2011-03-09 22:50:06 +00:00 committed by smallmodel
parent 5b567f4cba
commit 7c28efe9cd
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -568,7 +568,6 @@ be after execing the config and default.
void Com_StartupVariable( const char *match ) {
int i;
char *s;
cvar_t *cv;
for (i=0 ; i < com_numConsoleLines ; i++) {
Cmd_TokenizeString( com_consoleLines[i] );
@ -577,11 +576,13 @@ void Com_StartupVariable( const char *match ) {
}
s = Cmd_Argv(1);
if ( !match || !strcmp( s, match ) ) {
Cvar_Set( s, Cmd_Argv(2) );
cv = Cvar_Get( s, "", 0 );
cv->flags |= CVAR_USER_CREATED;
// com_consoleLines[i] = 0;
if(!match || !strcmp(s, match))
{
if(Cvar_Flags(s) == CVAR_NONEXISTENT)
Cvar_Get(s, Cmd_Argv(2), CVAR_USER_CREATED);
else
Cvar_Set(s, Cmd_Argv(2));
}
}
}