[quake3-commits] r1919 - trunk/code/qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Mar 9 17:50:06 EST 2011


Author: thilo
Date: 2011-03-09 17:50:06 -0500 (Wed, 09 Mar 2011)
New Revision: 1919

Modified:
   trunk/code/qcommon/common.c
Log:
Fix bug where Com_StartupVariable would set CVAR_USER_CREATED on already existing cvars


Modified: trunk/code/qcommon/common.c
===================================================================
--- trunk/code/qcommon/common.c	2011-03-09 12:59:25 UTC (rev 1918)
+++ trunk/code/qcommon/common.c	2011-03-09 22:50:06 UTC (rev 1919)
@@ -451,7 +451,6 @@
 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] );
@@ -460,11 +459,13 @@
 		}
 
 		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));
 		}
 	}
 }



More information about the quake3-commits mailing list