1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Mod system improvement Part I : Fix redefined content handler assertion

This commit is contained in:
Dmitry Orlov 2020-10-04 00:06:25 +03:00
parent f4816b0824
commit 6a7296fbe9

View File

@ -193,9 +193,14 @@ void CObjectClassesHandler::loadObjectEntry(const std::string & identifier, cons
}
logGlobal->debug("Loaded object %s(%d)::%s(%d)", obj->identifier, obj->id, convertedId, id);
assert(!obj->subObjects.count(id)); // DO NOT override
obj->subObjects[id] = handler;
obj->subIds[convertedId] = id;
//some mods redefine content handlers in the decoration.json in such way:
//"core:sign" : { "types" : { "forgeSign" : { ...
if (!obj->subObjects.count(id)) // DO NOT override
{
obj->subObjects[id] = handler;
obj->subIds[convertedId] = id;
}
}
CObjectClassesHandler::ObjectContainter * CObjectClassesHandler::loadFromJson(const JsonNode & json, const std::string & name)