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

Fixed meta field handling in JsonUtils::inherit function, removed

workarounds
This commit is contained in:
Ivan Savenko
2022-11-30 17:38:53 +02:00
parent 79c96e94fa
commit 5cd405bce8
3 changed files with 21 additions and 18 deletions

View File

@ -360,17 +360,9 @@ void CObjectClassesHandler::beforeValidate(JsonNode & object)
{
for (auto & entry : object["types"].Struct())
{
JsonNode base = object["base"];
base.setMeta(entry.second.meta);
JsonUtils::inherit(entry.second, base);
JsonUtils::inherit(entry.second, object["base"]);
for (auto & templ : entry.second["templates"].Struct())
{
JsonNode subBase = entry.second["base"];
subBase.setMeta(entry.second.meta);
JsonUtils::inherit(templ.second, subBase);
}
JsonUtils::inherit(templ.second, entry.second["base"]);
}
}