mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Fix VMs forcing engine latch cvar to update to latched value
A few commits ago I stopped VM's Cvar_Set() from instantly updating latched values. Now VM can't call Cvar_Register() afterword to force latched value to be used. Reported by Noah Metzger (Chomenor).
This commit is contained in:
parent
3638f69dff
commit
ed8d48cac3
1 changed files with 7 additions and 1 deletions
|
@ -1376,7 +1376,13 @@ void Cvar_Register(vmCvar_t *vmCvar, const char *varName, const char *defaultVal
|
||||||
if ( cv && ( cv->flags & CVAR_PROTECTED ) ) {
|
if ( cv && ( cv->flags & CVAR_PROTECTED ) ) {
|
||||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to register protected cvar '%s' with value '%s'%s\n",
|
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to register protected cvar '%s' with value '%s'%s\n",
|
||||||
varName, defaultValue, ( flags & ~cv->flags ) != 0 ? " and new flags" : "" );
|
varName, defaultValue, ( flags & ~cv->flags ) != 0 ? " and new flags" : "" );
|
||||||
} else {
|
}
|
||||||
|
// Don't set engine latch cvar to latched value.
|
||||||
|
else if ( cv && ( cv->flags & CVAR_LATCH ) && !( cv->flags & CVAR_VM_CREATED ) ) {
|
||||||
|
cv->flags |= flags;
|
||||||
|
cvar_modifiedFlags |= flags;
|
||||||
|
}
|
||||||
|
else {
|
||||||
cv = Cvar_Get(varName, defaultValue, flags | CVAR_VM_CREATED);
|
cv = Cvar_Get(varName, defaultValue, flags | CVAR_VM_CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue