1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Mod system improvement Part I : Old saves support & MSVS build fix

This commit is contained in:
Dmitry Orlov
2020-10-07 15:12:32 +03:00
parent 6a7296fbe9
commit bf07cd0ad9
8 changed files with 267 additions and 118 deletions

View File

@ -214,7 +214,7 @@ CObjectClassesHandler::ObjectContainter * CObjectClassesHandler::loadFromJson(co
if(json["defaultAiValue"].isNull())
obj->groupDefaultAiValue = boost::none;
else
obj->groupDefaultAiValue = static_cast<si32>(json["defaultAiValue"].Integer());
obj->groupDefaultAiValue = static_cast<boost::optional<si32>>(json["defaultAiValue"].Integer());
for (auto entry : json["types"].Struct())
{
@ -475,7 +475,7 @@ void AObjectTypeHandler::init(const JsonNode & input, boost::optional<std::strin
if(input["aiValue"].isNull())
aiValue = boost::none;
else
aiValue = static_cast<si32>(input["aiValue"].Integer());
aiValue = static_cast<boost::optional<si32>>(input["aiValue"].Integer());
initTypeData(input);
}