From 5fedda08d7c873a3c41d5aad8a792de8d38fb68f Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Thu, 24 Sep 2020 19:50:22 +0200 Subject: [PATCH] More fixes 3 --- core/src/config.cpp | 4 ++-- core/src/config.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/config.cpp b/core/src/config.cpp index ae03cac1..39ad79f1 100644 --- a/core/src/config.cpp +++ b/core/src/config.cpp @@ -8,7 +8,7 @@ void ConfigManager::setPath(std::string file) { path = file; } -void ConfigManager::load(json default, bool lock) { +void ConfigManager::load(json def, bool lock) { if (lock) { mtx.lock(); } if (path == "") { spdlog::error("Config manager tried to load file with no path specified"); @@ -16,7 +16,7 @@ void ConfigManager::load(json default, bool lock) { } if (!std::filesystem::exists(path)) { spdlog::warn("Config file '{0}' does not exist, creating it", path); - conf = default; + conf = def; save(false); } if (!std::filesystem::is_regular_file(path)) { diff --git a/core/src/config.h b/core/src/config.h index d9f7da19..6a327d8e 100644 --- a/core/src/config.h +++ b/core/src/config.h @@ -27,7 +27,7 @@ class ConfigManager { public: ConfigManager(); void setPath(std::string file); - void load(json default, bool lock = true); + void load(json def, bool lock = true); void save(bool lock = true); void enableAutoSave(); void disableAutoSave();