mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Merge branch 'cvar-zstring-fix' into 'next'
Unset zstring if a preset value is used Closes #487 See merge request STJr/SRB2!1479
This commit is contained in:
commit
83a80106b1
1 changed files with 4 additions and 7 deletions
|
@ -1441,6 +1441,10 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
|
|||
return;
|
||||
}
|
||||
|
||||
// free the old value string
|
||||
Z_Free(var->zstring);
|
||||
var->zstring = NULL;
|
||||
|
||||
var->value = var->PossibleValue[i].value;
|
||||
var->string = var->PossibleValue[i].strvalue;
|
||||
goto finish;
|
||||
|
@ -1503,14 +1507,7 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
|
|||
found:
|
||||
if (client && execversion_enabled)
|
||||
{
|
||||
if (var->revert.allocated)
|
||||
{
|
||||
Z_Free(var->revert.v.string);
|
||||
var->revert.allocated = false; // the below value is not allocated in zone memory, don't try to free it!
|
||||
}
|
||||
|
||||
var->revert.v.const_munge = var->PossibleValue[i].strvalue;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue