diff --git a/config/heroes/tower.json b/config/heroes/tower.json index 0fecfc54b..4ddc15e86 100644 --- a/config/heroes/tower.json +++ b/config/heroes/tower.json @@ -70,6 +70,7 @@ "torosar": { "index": 36, + "compatibilityIdentifiers" : [ "torosar " ], "class" : "alchemist", "female": false, "spellbook": [ "magicArrow" ], diff --git a/lib/CHeroHandler.cpp b/lib/CHeroHandler.cpp index a882cda0b..b8ba71690 100644 --- a/lib/CHeroHandler.cpp +++ b/lib/CHeroHandler.cpp @@ -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