mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Added workaround for crashes with outdated mods
This commit is contained in:
@@ -133,7 +133,7 @@ void CHeroInstanceConstructor::afterLoadFinalization()
|
||||
{
|
||||
filters[entry.first] = LogicalExpression<HeroTypeID>(entry.second, [](const JsonNode & node)
|
||||
{
|
||||
return HeroTypeID(VLC->identifiers()->getIdentifier("hero", node.Vector()[0]).value());
|
||||
return HeroTypeID(VLC->identifiers()->getIdentifier("hero", node.Vector()[0]).value_or(-1));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user