Skip to content

Commit b7f01b0

Browse files
authored
Don't save load_mod_* = false lines in world.mt (luanti-org#15758)
1 parent 54bf5d6 commit b7f01b0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

builtin/mainmenu/dlg_config_world.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ local function handle_buttons(this, fields)
299299
worldfile:set("load_mod_" .. mod.name, mod.virtual_path)
300300
was_set[mod.name] = true
301301
elseif not was_set[mod.name] then
302-
worldfile:set("load_mod_" .. mod.name, "false")
302+
worldfile:remove("load_mod_" .. mod.name)
303303
end
304304
elseif mod.enabled then
305305
gamedata.errormessage = fgettext_ne("Failed to enable mo" ..

src/content/mod_configuration.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ void ModConfiguration::addModsFromConfig(
140140
*
141141
* Alternative candidates for a modname are stored in `candidates`,
142142
* and used in an error message later.
143-
*
144-
* If not enabled, add `load_mod_modname = false` to world.mt
145143
*/
146144
for (const auto &modPath : modPaths) {
147145
std::vector<ModSpec> addon_mods_in_path = flattenMods(getModsInPath(modPath.second, modPath.first));
@@ -154,7 +152,7 @@ void ModConfiguration::addModsFromConfig(
154152
candidates[pair->first].emplace_back(mod.virtual_path);
155153
}
156154
} else {
157-
conf.setBool("load_mod_" + mod.name, false);
155+
conf.remove("load_mod_" + mod.name);
158156
}
159157
}
160158
}

0 commit comments

Comments
 (0)