mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Mod system improvement Part I : Fix redefined content handler assertion
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user