From 2bf840764060df8bccabbe8ee3cfabba1b3e54f6 Mon Sep 17 00:00:00 2001 From: neru Date: Sat, 11 Apr 2026 16:00:46 -0300 Subject: [PATCH] fix: use config values from default member initialization --- src/unlocker/spoofing.cpp | 17 ++++++++++------- src/unlocker/spoofing.h | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/unlocker/spoofing.cpp b/src/unlocker/spoofing.cpp index 8c0feae..ed1f831 100644 --- a/src/unlocker/spoofing.cpp +++ b/src/unlocker/spoofing.cpp @@ -103,11 +103,10 @@ void Spoofer::loadConfig() try { json configJson = json::parse(configFile); - _config.spoofCharacterOwnership = configJson.value("spoofCharacterOwnership", false); - _config.spoofInventory = configJson.value("spoofInventory", true); - _config.spoofCustomization = configJson.value("spoofCustomization", true); - Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}", _config.spoofCharacterOwnership, - _config.spoofInventory, _config.spoofCustomization); + _config.spoofCharacterOwnership = + configJson.value("spoofCharacterOwnership", _config.spoofCharacterOwnership); + _config.spoofInventory = configJson.value("spoofInventory", _config.spoofInventory); + _config.spoofCustomization = configJson.value("spoofCustomization", _config.spoofCustomization); } catch (...) { @@ -117,11 +116,15 @@ void Spoofer::loadConfig() else { Log::info("config.json not found, using default settings"); - json defaultConfig = { - {"spoofCharacterOwnership", true}, {"spoofInventory", true}, {"spoofCustomization", true}}; + json defaultConfig = {{"spoofCharacterOwnership", _config.spoofCharacterOwnership}, + {"spoofInventory", _config.spoofInventory}, + {"spoofCustomization", _config.spoofCustomization}}; std::ofstream out(configPath); out << defaultConfig.dump(4); } + + Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}", _config.spoofCharacterOwnership, + _config.spoofInventory, _config.spoofCustomization); } /* diff --git a/src/unlocker/spoofing.h b/src/unlocker/spoofing.h index d1087b4..ce6feab 100644 --- a/src/unlocker/spoofing.h +++ b/src/unlocker/spoofing.h @@ -12,8 +12,8 @@ struct SpooferConfig { bool spoofCharacterOwnership = false; - bool spoofInventory = false; - bool spoofCustomization = false; + bool spoofInventory = true; + bool spoofCustomization = true; }; class Spoofer