Fix per-game config values leaking across titles #2325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per-Game Config Bug Fix
The Problem
Settings from one game were incorrectly persisting when loading a different game. When Game A defined configuration values in its TOML file and Game B did not override those same settings, Game B would still use Game A's values. This occurred because the cvar system retained the previous game's game_config_value_ state without clearing it before loading the next title's configuration.
The Solution
This patch adds a cleanup step that resets all per-game overrides before loading a new title's configuration. Each game now starts from global and default values unless it explicitly defines its own overrides.
Changes Made
Added reset method to config variables
Added system-wide reset function
Modified game config loading
Impact