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:
parent
f4816b0824
commit
6a7296fbe9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user