Skip to content

Commit

Permalink
Don't save load_mod_* = false lines in world.mt (luanti-org#15758)
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu authored Feb 14, 2025
1 parent 54bf5d6 commit b7f01b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion builtin/mainmenu/dlg_config_world.lua
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ local function handle_buttons(this, fields)
worldfile:set("load_mod_" .. mod.name, mod.virtual_path)
was_set[mod.name] = true
elseif not was_set[mod.name] then
worldfile:set("load_mod_" .. mod.name, "false")
worldfile:remove("load_mod_" .. mod.name)
end
elseif mod.enabled then
gamedata.errormessage = fgettext_ne("Failed to enable mo" ..
Expand Down
4 changes: 1 addition & 3 deletions src/content/mod_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ void ModConfiguration::addModsFromConfig(
*
* Alternative candidates for a modname are stored in `candidates`,
* and used in an error message later.
*
* If not enabled, add `load_mod_modname = false` to world.mt
*/
for (const auto &modPath : modPaths) {
std::vector<ModSpec> addon_mods_in_path = flattenMods(getModsInPath(modPath.second, modPath.first));
Expand All @@ -154,7 +152,7 @@ void ModConfiguration::addModsFromConfig(
candidates[pair->first].emplace_back(mod.virtual_path);
}
} else {
conf.setBool("load_mod_" + mod.name, false);
conf.remove("load_mod_" + mod.name);
}
}
}
Expand Down

0 comments on commit b7f01b0

Please sign in to comment.