mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Add workaround for loading save when entity was moved to another mod
This commit is contained in:
@@ -158,6 +158,16 @@ int32_t IdentifierBase::resolveIdentifier(const std::string & entityType, const
|
||||
|
||||
if (rawId)
|
||||
return rawId.value();
|
||||
|
||||
size_t semicolon = identifier.find(':');
|
||||
|
||||
if (semicolon != std::string::npos)
|
||||
{
|
||||
auto rawId2 = LIBRARY->identifiers()->getIdentifier(ModScope::scopeGame(), entityType, identifier.substr(semicolon + 1));
|
||||
if (rawId2)
|
||||
return rawId2.value();
|
||||
}
|
||||
|
||||
throw IdentifierResolutionException(identifier);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user