diff --git a/changelog.txt b/changelog.txt index 8e61000..0c0bb91 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,8 @@ DD Mmm 19 - 1.52 fix: r_monitor on Linux is now 0-based and the value doesn't change incorrectly on its own anymore +fix: when a latched cvar's value is set to its default, the cvar is no longer marked as changed + 31 Mar 19 - 1.51 diff --git a/code/qcommon/cvar.cpp b/code/qcommon/cvar.cpp index 42b88cc..e6f68fc 100644 --- a/code/qcommon/cvar.cpp +++ b/code/qcommon/cvar.cpp @@ -304,8 +304,13 @@ static cvar_t* Cvar_Set2( const char *var_name, const char *value, qbool force ) } const qbool okValue = Cvar_IsValidValue(var, value, qtrue); - if (okValue && !strcmp(value, var->string)) + if (okValue && !strcmp(value, var->string)) { + if (var->latchedString) { + Z_Free(var->latchedString); + var->latchedString = NULL; + } return var; + } if (!okValue) { if (!Cvar_IsValidValue(var, var->resetString, qfalse))