mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-02-01 13:20:50 +00:00
setting a cvar back to its default frees the latched string
This commit is contained in:
parent
30c8990d6b
commit
2d806401eb
2 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue