From fd297f08e2f987ab16e94f7697c76423f26aaf1c Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 10 Jul 2024 22:33:09 +0000 Subject: [PATCH] Add quick workaround for loading identifiers from difficulty bonuses --- lib/gameState/CGameState.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/gameState/CGameState.cpp b/lib/gameState/CGameState.cpp index 009691744..f0d4aa938 100644 --- a/lib/gameState/CGameState.cpp +++ b/lib/gameState/CGameState.cpp @@ -44,6 +44,7 @@ #include "../mapping/CMapEditManager.h" #include "../mapping/CMapService.h" #include "../modding/IdentifierStorage.h" +#include "../modding/ModScope.h" #include "../pathfinder/CPathfinder.h" #include "../pathfinder/PathfinderOptions.h" #include "../registerTypes/RegisterTypesClientPacks.h" @@ -413,7 +414,8 @@ void CGameState::initGlobalBonuses() void CGameState::initDifficulty() { logGlobal->debug("\tLoading difficulty settings"); - const JsonNode config = JsonUtils::assembleFromFiles("config/difficulty.json"); + JsonNode config = JsonUtils::assembleFromFiles("config/difficulty.json"); + config.setModScope(ModScope::scopeGame()); // FIXME: should be set to actual mod const JsonNode & difficultyAI(config["ai"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]); const JsonNode & difficultyHuman(config["human"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]);