mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-03-13 22:23:04 +00:00
the mismatching initial values developer cvar warning only gets printed once
This commit is contained in:
parent
172b6a0e9a
commit
998ad98511
2 changed files with 4 additions and 1 deletions
|
@ -273,9 +273,11 @@ cvar_t* Cvar_Get( const char *var_name, const char *var_value, int flags )
|
|||
if ((flags & CVAR_ROM) || !var->resetString[0]) {
|
||||
Z_Free( var->resetString );
|
||||
var->resetString = CopyString( var_value );
|
||||
} else if ( var_value[0] && strcmp( var->resetString, var_value ) ) {
|
||||
} else if ( com_developer && com_developer->integer && !var->mismatchPrinted &&
|
||||
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 );
|
||||
var->mismatchPrinted = qtrue;
|
||||
}
|
||||
|
||||
// if we have a latched string, take that value now
|
||||
|
|
|
@ -420,6 +420,7 @@ typedef struct cvar_s {
|
|||
int modificationCount; // incremented each time the cvar is changed
|
||||
float value; // atof( string )
|
||||
int integer; // atoi( string )
|
||||
qbool mismatchPrinted; // have we already notified of mismatching initial values?
|
||||
struct cvar_s *next;
|
||||
struct cvar_s *hashNext;
|
||||
} cvar_t;
|
||||
|
|
Loading…
Reference in a new issue