1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Fixed crashes on loading with Tides of War mod

This commit is contained in:
Ivan Savenko 2023-07-15 13:05:27 +03:00
parent 189a0c6e0d
commit 0a27539fb5
2 changed files with 5 additions and 2 deletions

View File

@ -541,7 +541,7 @@ void TargetCondition::loadConditions(const JsonNode & source, bool exclusive, bo
CModHandler::parseIdentifier(keyValue.first, scope, type, identifier);
item = itemFactory->createConfigurable(scope, type, identifier);
item = itemFactory->createConfigurable(keyValue.second.meta, type, identifier);
}
if(item)

View File

@ -250,7 +250,10 @@ void Timed::serializeJsonUnitEffect(JsonSerializeFormat & handler)
auto guard = handler.enterStruct(p.first);
const JsonNode & bonusNode = handler.getCurrent();
auto b = JsonUtils::parseBonus(bonusNode);
bonus.push_back(b);
if (b)
bonus.push_back(b);
else
logMod->error("Failed to parse bonus '%s'!", p.first);
}
}
}