mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix: Creature resolution failed when mod is in the custom directory
This commit is contained in:
@@ -37,6 +37,18 @@ void JsonDeserializer::serializeInternal(const std::string & fieldName, si32 & v
|
||||
if(identifier != "")
|
||||
{
|
||||
si32 rawId = decoder(identifier);
|
||||
|
||||
if(rawId < 0) //may be, user has installed the mod into another directory...
|
||||
{
|
||||
auto internalId = vstd::splitStringToPair(identifier, ':').second;
|
||||
auto currentScope = getCurrent().meta;
|
||||
auto actualId = currentScope.length() > 0 ? currentScope + ":" + internalId : internalId;
|
||||
|
||||
rawId = decoder(actualId);
|
||||
|
||||
if(rawId >= 0)
|
||||
logMod->warn("Identifier %s has been resolved as %s instead of %s", internalId, actualId, identifier);
|
||||
}
|
||||
if(rawId >= 0)
|
||||
value = rawId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user