File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ local function handle_buttons(this, fields)
138
138
not mod .is_game_content then
139
139
if modname_valid (mod .name ) then
140
140
worldfile :set (" load_mod_" .. mod .name ,
141
- tostring ( mod .enabled ) )
141
+ mod .enabled and " true " or " false " )
142
142
elseif mod .enabled then
143
143
gamedata .errormessage = fgettext_ne (" Failed to enable mo" ..
144
144
" d \" $1\" as it contains disallowed characters. " ..
Original file line number Diff line number Diff line change @@ -391,7 +391,10 @@ function pkgmgr.get_worldconfig(worldpath)
391
391
if key == " gameid" then
392
392
worldconfig .id = value
393
393
elseif key :sub (0 , 9 ) == " load_mod_" then
394
- worldconfig .global_mods [key ] = core .is_yes (value )
394
+ -- Compatibility: Check against "nil" which was erroneously used
395
+ -- as value for fresh configured worlds
396
+ worldconfig .global_mods [key ] = value ~= " false" and value ~= " nil"
397
+ and value
395
398
else
396
399
worldconfig [key ] = value
397
400
end
@@ -595,7 +598,7 @@ function pkgmgr.preparemodlist(data)
595
598
end
596
599
end
597
600
if element ~= nil then
598
- element .enabled = core . is_yes ( value )
601
+ element .enabled = value ~= " false " and value ~= " nil " and value
599
602
else
600
603
core .log (" info" , " Mod: " .. key .. " " .. dump (value ) .. " but not found" )
601
604
end
Original file line number Diff line number Diff line change @@ -274,7 +274,8 @@ void ModConfiguration::addModsFromConfig(
274
274
conf.readConfigFile (settings_path.c_str ());
275
275
std::vector<std::string> names = conf.getNames ();
276
276
for (const std::string &name : names) {
277
- if (name.compare (0 , 9 , " load_mod_" ) == 0 && conf.getBool (name))
277
+ if (name.compare (0 , 9 , " load_mod_" ) == 0 && conf.get (name) != " false" &&
278
+ conf.get (name) != " nil" )
278
279
load_mod_names.insert (name.substr (9 ));
279
280
}
280
281
You can’t perform that action at this time.
0 commit comments