mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Added workaround for crashes with outdated mods
This commit is contained in:
parent
6917e33ec3
commit
df78c9c6f1
@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,12 @@ void Summon::adjustTargetTypes(std::vector<TargetType> & types) const
|
||||
|
||||
bool Summon::applicable(Problem & problem, const Mechanics * m) const
|
||||
{
|
||||
if (creature == CreatureID::NONE)
|
||||
{
|
||||
logMod->error("Attempt to summon non-existing creature!");
|
||||
return m->adaptGenericProblem(problem);
|
||||
}
|
||||
|
||||
if(exclusive)
|
||||
{
|
||||
//check if there are summoned creatures of other type
|
||||
|
Loading…
Reference in New Issue
Block a user