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

Firts working version that launches original maps

This commit is contained in:
Tomasz Zieliński
2022-09-21 13:43:57 +02:00
parent 11e1bb44a2
commit c9c4603f75
4 changed files with 29 additions and 21 deletions

View File

@ -484,15 +484,22 @@ void AObjectTypeHandler::init(const JsonNode & input, boost::optional<std::strin
for (auto entry : input["templates"].Struct())
{
entry.second.setType(JsonNode::JsonType::DATA_STRUCT);
JsonUtils::inherit(entry.second, base);
try
{
entry.second.setType(JsonNode::JsonType::DATA_STRUCT);
JsonUtils::inherit(entry.second, base);
auto tmpl = new ObjectTemplate;
tmpl->id = Obj(type);
tmpl->subid = subtype;
tmpl->stringID = entry.first; // FIXME: create "fullID" - type.object.template?
tmpl->readJson(entry.second);
templates.push_back(std::shared_ptr<const ObjectTemplate>(tmpl));
auto tmpl = new ObjectTemplate;
tmpl->id = Obj(type);
tmpl->subid = subtype;
tmpl->stringID = entry.first; // FIXME: create "fullID" - type.object.template?
tmpl->readJson(entry.second);
templates.push_back(std::shared_ptr<const ObjectTemplate>(tmpl));
}
catch (const std::exception & e)
{
logGlobal->warn("Failed to load terrains for object %s: %s", entry.first, e.what());
}
}
if (input["name"].isNull())