1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Merge branch 'develop' of https://github.com/vcmi/vcmi into RMG

This commit is contained in:
DjWarmonger 2014-06-27 06:24:05 +02:00
commit ccb475b699
2 changed files with 12 additions and 9 deletions

View File

View File

@ -688,7 +688,19 @@ void CTownHandler::loadObject(std::string scope, std::string name, const JsonNod
JsonNode config = data["town"]["mapObject"];
config["faction"].String() = object->identifier;
config["faction"].meta = scope;
if (config.meta.empty())// MODS COMPATIBILITY FOR 0.96
config.meta = scope;
VLC->objtypeh->loadSubObject(object->identifier, config, index, object->index);
// MODS COMPATIBILITY FOR 0.96
auto & advMap = data["town"]["adventureMap"];
if (!advMap.isNull())
{
logGlobal->warnStream() << "Outdated town mod. Will try to generate valid templates out of fort";
JsonNode config;
config["animation"] = advMap["castle"];
VLC->objtypeh->getHandlerFor(index, object->index)->addTemplate(config);
}
});
}
@ -717,15 +729,6 @@ void CTownHandler::loadObject(std::string scope, std::string name, const JsonNod
config["faction"].String() = object->identifier;
config["faction"].meta = scope;
VLC->objtypeh->loadSubObject(object->identifier, config, index, object->index);
// MODS COMPATIBILITY FOR 0.96
auto & advMap = data["town"]["adventureMap"];
if (!advMap["fort"].isNull())
{
JsonNode config;
config["appearance"] = advMap["fort"];
VLC->objtypeh->getHandlerFor(index, object->index)->addTemplate(config);
}
});
}