not mod.is_game_content then
if modname_valid(mod.name) then
worldfile:set("load_mod_" .. mod.name,
- tostring(mod.enabled))
+ mod.enabled and "true" or "false")
elseif mod.enabled then
gamedata.errormessage = fgettext_ne("Failed to enable mo" ..
"d \"$1\" as it contains disallowed characters. " ..
if key == "gameid" then
worldconfig.id = value
elseif key:sub(0, 9) == "load_mod_" then
- worldconfig.global_mods[key] = core.is_yes(value)
+ -- Compatibility: Check against "nil" which was erroneously used
+ -- as value for fresh configured worlds
+ worldconfig.global_mods[key] = value ~= "false" and value ~= "nil"
+ and value
else
worldconfig[key] = value
end
end
end
if element ~= nil then
- element.enabled = core.is_yes(value)
+ element.enabled = value ~= "false" and value ~= "nil" and value
else
core.log("info", "Mod: " .. key .. " " .. dump(value) .. " but not found")
end
conf.readConfigFile(settings_path.c_str());
std::vector<std::string> names = conf.getNames();
for (const std::string &name : names) {
- if (name.compare(0, 9, "load_mod_") == 0 && conf.getBool(name))
+ if (name.compare(0, 9, "load_mod_") == 0 && conf.get(name) != "false" &&
+ conf.get(name) != "nil")
load_mod_names.insert(name.substr(9));
}