1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Compatibility hack for mods with old banks format

This commit is contained in:
Ivan Savenko 2024-09-21 15:11:57 +00:00
parent 43666ec987
commit 9ee2ee45bc

View File

@ -203,6 +203,11 @@ TObjectTypeHandler CObjectClassesHandler::loadSubObjectFromJson(const std::strin
assert(handlerConstructors.count(handler) != 0);
}
// Compatibility with 1.5 mods for 1.6. To be removed in 1.7
// Detect banks that use old format and load them using old bank hander
if (baseObject->id == Obj::CREATURE_BANK && entry.Struct().count("levels") && !entry.Struct().count("rewards"))
handler = "bank";
auto createdObject = handlerConstructors.at(handler)();
createdObject->modScope = scope;