From b863dd098c133889a2c66b60218306e2b3b81fb4 Mon Sep 17 00:00:00 2001 From: thilo Date: Thu, 1 May 2008 14:56:57 +0000 Subject: - replace a few constant values with GL macros in tr_cmds.c - tidy up top of tr_types.h a bit, change flags to hex representation - make ROM cvar enforcing really work - remove cg_stereoSeparation from cgame as it is obsolete. - Add CG_DrawCrosshair3D so people see crosshair correctly when stereoseparation is enabled git-svn-id: svn://svn.icculus.org/quake3/trunk@1335 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/cvar.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'code/qcommon') diff --git a/code/qcommon/cvar.c b/code/qcommon/cvar.c index 9dfff2e..2526e38 100644 --- a/code/qcommon/cvar.c +++ b/code/qcommon/cvar.c @@ -228,6 +228,17 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) { Z_Free( var->resetString ); var->resetString = CopyString( var_value ); + if(flags & CVAR_ROM) + { + // this variable was set by the user, + // so force it to value given by the engine. + + if(var->latchedString) + Z_Free(var->latchedString); + + var->latchedString = CopyString(var_value); + } + // ZOID--needs to be set so that cvars the game sets as // SERVERINFO get sent to clients cvar_modifiedFlags |= flags; @@ -239,16 +250,6 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) { // we don't have a reset string yet Z_Free( var->resetString ); var->resetString = CopyString( var_value ); - - // if there is no reset string yet this means the variable was set by the user, - // so force it to value given by the engine. - if(var->flags & CVAR_ROM) - { - if(var->latchedString) - Z_Free(var->latchedString); - - var->latchedString = CopyString(var_value); - } } else if ( var_value[0] && strcmp( var->resetString, var_value ) ) { Com_DPrintf( "Warning: cvar \"%s\" given initial values: \"%s\" and \"%s\"\n", var_name, var->resetString, var_value ); -- cgit v1.2.3