Applied values to latched CVARs in correct order

https://forum.zdoom.org/viewtopic.php?t=59159
This commit is contained in:
alexey.lysiuk 2018-01-20 13:53:13 +02:00
parent 94720f8a96
commit 7a1ec9ab9d
1 changed files with 3 additions and 3 deletions

View File

@ -1639,9 +1639,7 @@ FBaseCVar *C_CreateCVar(const char *var_name, ECVarType var_type, uint32_t flags
void UnlatchCVars (void)
{
FLatchedValue var;
while (LatchedValues.Pop (var))
for (const FLatchedValue& var : LatchedValues)
{
uint32_t oldflags = var.Variable->Flags;
var.Variable->Flags &= ~(CVAR_LATCH | CVAR_SERVERINFO);
@ -1650,6 +1648,8 @@ void UnlatchCVars (void)
delete[] var.Value.String;
var.Variable->Flags = oldflags;
}
LatchedValues.Clear();
}
void DestroyCVarsFlagged (uint32_t flags)