mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Added workaround for references to old 'torosar ' ID
This commit is contained in:
parent
9e09fe08e1
commit
a18f9d1e8d
@ -70,6 +70,7 @@
|
||||
"torosar":
|
||||
{
|
||||
"index": 36,
|
||||
"compatibilityIdentifiers" : [ "torosar " ],
|
||||
"class" : "alchemist",
|
||||
"female": false,
|
||||
"spellbook": [ "magicArrow" ],
|
||||
|
@ -326,6 +326,8 @@ CHeroClass * CHeroClassHandler::loadFromJson(const std::string & scope, const Js
|
||||
{
|
||||
JsonNode classConf = node["mapObject"];
|
||||
classConf["heroClass"].String() = identifier;
|
||||
if (!node["compatibilityIdentifiers"].isNull())
|
||||
classConf["compatibilityIdentifiers"] = node["compatibilityIdentifiers"];
|
||||
classConf.setMeta(scope);
|
||||
VLC->objtypeh->loadSubObject(identifier, classConf, index, heroClass->getIndex());
|
||||
});
|
||||
@ -756,6 +758,9 @@ void CHeroHandler::loadObject(std::string scope, std::string name, const JsonNod
|
||||
objects.emplace_back(object);
|
||||
|
||||
registerObject(scope, "hero", name, object->getIndex());
|
||||
|
||||
for(const auto & compatID : data["compatibilityIdentifiers"].Vector())
|
||||
registerObject(scope, "hero", compatID.String(), object->getIndex());
|
||||
}
|
||||
|
||||
void CHeroHandler::loadObject(std::string scope, std::string name, const JsonNode & data, size_t index)
|
||||
@ -767,6 +772,8 @@ void CHeroHandler::loadObject(std::string scope, std::string name, const JsonNod
|
||||
objects[index] = object;
|
||||
|
||||
registerObject(scope, "hero", name, object->getIndex());
|
||||
for(const auto & compatID : data["compatibilityIdentifiers"].Vector())
|
||||
registerObject(scope, "hero", compatID.String(), object->getIndex());
|
||||
}
|
||||
|
||||
ui32 CHeroHandler::level (TExpType experience) const
|
||||
|
Loading…
Reference in New Issue
Block a user