diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-18 13:27:54 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-18 13:27:54 +0200 |
| commit | cec248d176f658e91281711de83cca583ef64cab (patch) | |
| tree | b9f92f7c59d89930456ebcfb0d923bbb595a8e42 /src/config/ConfigManager.cpp | |
| parent | 24316f2e717237d754c6b1ce75be024e4ef34edb (diff) | |
set default var if not present in config
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 54bc2c0c..30585502 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -11,6 +11,10 @@ #include <iostream> CConfigManager::CConfigManager() { + setDefaultVars(); +} + +void CConfigManager::setDefaultVars() { configValues["general:max_fps"].intValue = 240; configValues["general:sensitivity"].floatValue = 0.25f; configValues["general:apply_sens_to_raw"].intValue = 1; @@ -309,7 +313,9 @@ void CConfigManager::loadConfigLoadVars() { Debug::log(LOG, "Reloading the config!"); parseError = ""; // reset the error currentCategory = ""; // reset the category - configValues["autogenerated"].intValue = 0; // reset autogenerated status + + // reset all vars before loading + setDefaultVars(); m_dMonitorRules.clear(); m_dWindowRules.clear(); |
