1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fix scope of identifiers resolving for commanders abilities

This commit is contained in:
Ivan Savenko 2023-04-03 01:12:04 +03:00
parent 2b1def4ef1
commit 10e852fcb9

View File

@ -432,8 +432,11 @@ const CCreature * CCreatureHandler::getCreature(const std::string & scope, const
void CCreatureHandler::loadCommanders()
{
JsonNode data(ResourceID("config/commanders.json"));
data.setMeta(CModHandler::scopeBuiltin()); // assume that commanders are in core mod (for proper bonuses resolution)
ResourceID configResource("config/commanders.json");
std::string modSource = VLC->modh->findResourceOrigin(configResource);
JsonNode data(configResource);
data.setMeta(modSource);
const JsonNode & config = data; // switch to const data accessors