mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	- new mods (not mentioned in modSettings.json) will be enabled by
default
This commit is contained in:
		| @@ -158,10 +158,17 @@ CModEntry CModList::getMod(QString modname) const | |||||||
| 	QVariantMap settings; | 	QVariantMap settings; | ||||||
|  |  | ||||||
| 	QVariant conf = modSettings[modname]; | 	QVariant conf = modSettings[modname]; | ||||||
| 	if (conf.canConvert<QVariantMap>()) | 	if (conf.isNull()) | ||||||
| 		settings = modSettings[modname].toMap(); | 	{ | ||||||
|  | 		settings["active"] = true; // default | ||||||
|  | 	} | ||||||
| 	else | 	else | ||||||
| 		settings.insert("active", conf); | 	{ | ||||||
|  | 		if (conf.canConvert<QVariantMap>()) | ||||||
|  | 			settings = modSettings[modname].toMap(); | ||||||
|  | 		else | ||||||
|  | 			settings.insert("active", conf); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	for (auto entry : repositories) | 	for (auto entry : repositories) | ||||||
| 	{ | 	{ | ||||||
|   | |||||||
| @@ -603,7 +603,7 @@ void CModInfo::loadLocalData(const JsonNode & data) | |||||||
| 	{ | 	{ | ||||||
| 		enabled = data.Bool(); | 		enabled = data.Bool(); | ||||||
| 	} | 	} | ||||||
| 	else | 	if (data.getType() == JsonNode::DATA_STRUCT) | ||||||
| 	{ | 	{ | ||||||
| 		enabled   = data["active"].Bool(); | 		enabled   = data["active"].Bool(); | ||||||
| 		validated = data["validated"].Bool(); | 		validated = data["validated"].Bool(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user