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

- new mods (not mentioned in modSettings.json) will be enabled by

default
This commit is contained in:
Ivan Savenko 2014-01-30 14:51:15 +00:00
parent 679c3c5830
commit 27be6a8f13
2 changed files with 11 additions and 4 deletions

View File

@ -158,10 +158,17 @@ CModEntry CModList::getMod(QString modname) const
QVariantMap settings;
QVariant conf = modSettings[modname];
if (conf.canConvert<QVariantMap>())
settings = modSettings[modname].toMap();
if (conf.isNull())
{
settings["active"] = true; // default
}
else
settings.insert("active", conf);
{
if (conf.canConvert<QVariantMap>())
settings = modSettings[modname].toMap();
else
settings.insert("active", conf);
}
for (auto entry : repositories)
{

View File

@ -603,7 +603,7 @@ void CModInfo::loadLocalData(const JsonNode & data)
{
enabled = data.Bool();
}
else
if (data.getType() == JsonNode::DATA_STRUCT)
{
enabled = data["active"].Bool();
validated = data["validated"].Bool();