forked from Mirrorlandia_minetest/minetest
Fix broken dependency enabling due to missing enabled
field (#12093)
This commit is contained in:
parent
f7311e0d97
commit
7db751df3b
@ -414,17 +414,17 @@ local function toggle_mod_or_modpack(list, toggled_mods, enabled_mods, toset, mo
|
|||||||
if toset == nil then
|
if toset == nil then
|
||||||
toset = not mod.enabled
|
toset = not mod.enabled
|
||||||
end
|
end
|
||||||
if toset then
|
|
||||||
disable_all_by_name(list, mod.name, mod)
|
|
||||||
end
|
|
||||||
if mod.enabled ~= toset then
|
if mod.enabled ~= toset then
|
||||||
mod.enabled = toset
|
|
||||||
toggled_mods[#toggled_mods+1] = mod.name
|
toggled_mods[#toggled_mods+1] = mod.name
|
||||||
end
|
end
|
||||||
if toset then
|
if toset then
|
||||||
-- Mark this mod for recursive dependency traversal
|
-- Mark this mod for recursive dependency traversal
|
||||||
enabled_mods[mod.name] = true
|
enabled_mods[mod.name] = true
|
||||||
|
|
||||||
|
-- Disable other mods with the same name
|
||||||
|
disable_all_by_name(list, mod.name, mod)
|
||||||
end
|
end
|
||||||
|
mod.enabled = toset
|
||||||
else
|
else
|
||||||
-- Toggle or en/disable every mod in the modpack,
|
-- Toggle or en/disable every mod in the modpack,
|
||||||
-- interleaved unsupported
|
-- interleaved unsupported
|
||||||
@ -481,6 +481,7 @@ function pkgmgr.enable_mod(this, toset)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If sp is 0, every dependency is already activated
|
-- If sp is 0, every dependency is already activated
|
||||||
while sp > 0 do
|
while sp > 0 do
|
||||||
local name = to_enable[sp]
|
local name = to_enable[sp]
|
||||||
@ -493,7 +494,7 @@ function pkgmgr.enable_mod(this, toset)
|
|||||||
core.log("warning", "Mod dependency \"" .. name ..
|
core.log("warning", "Mod dependency \"" .. name ..
|
||||||
"\" not found!")
|
"\" not found!")
|
||||||
else
|
else
|
||||||
if mod_to_enable.enabled == false then
|
if not mod_to_enable.enabled then
|
||||||
mod_to_enable.enabled = true
|
mod_to_enable.enabled = true
|
||||||
toggled_mods[#toggled_mods+1] = mod_to_enable.name
|
toggled_mods[#toggled_mods+1] = mod_to_enable.name
|
||||||
end
|
end
|
||||||
@ -668,6 +669,7 @@ function pkgmgr.preparemodlist(data)
|
|||||||
for i=1,#global_mods,1 do
|
for i=1,#global_mods,1 do
|
||||||
global_mods[i].type = "mod"
|
global_mods[i].type = "mod"
|
||||||
global_mods[i].loc = "global"
|
global_mods[i].loc = "global"
|
||||||
|
global_mods[i].enabled = false
|
||||||
retval[#retval + 1] = global_mods[i]
|
retval[#retval + 1] = global_mods[i]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user