Skip to content

Commit 7d43778

Browse files
committed
Fix cvar changes sometimes not writing autogen
A command such as /set common.framerate.max 99, when the cvar was previously marked as archive, could fail to cause the configuration file to be written out. This happened because the code relied on the flags field of the C API cvar_t object to detect updates, but Cvar::AddFlags failed to update cvar_t. Note that setting cvars in the UI was not affected because the UI re-adds the archive flag every time and the act of adding the flag triggers an update.
1 parent 94593e4 commit 7d43778

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/engine/framework/CvarSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ namespace Cvar {
416416
}
417417

418418
cvar->flags |= flags;
419+
cvar->ccvar.flags |= flags;
419420

420-
//TODO: remove it, overkill ?
421421
//Make sure to trigger the event as if this variable was changed
422422
cvar_modifiedFlags |= flags;
423423
return true; // success

0 commit comments

Comments
 (0)