Skip to content

Commit

Permalink
fix(mainmenu): Cannot display the mod has been enabled If this mod is…
Browse files Browse the repository at this point in the history
… available in both global mods and modpack. fixed: minetest#11552
  • Loading branch information
snowyu committed Aug 18, 2021
1 parent 3b842a7 commit 90091fe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions builtin/mainmenu/pkgmgr.lua
Expand Up @@ -730,13 +730,20 @@ function pkgmgr.preparemodlist(data)
if key:sub(1, 9) == "load_mod_" then
key = key:sub(10)
local element = nil
local modpack_elem = nil
for i=1,#retval,1 do
if retval[i].name == key and
not retval[i].is_modpack then
element = retval[i]
break
if retval[i].modpack then
-- remember the element in modpack and continue to search
modpack_elem = retval[i]
else
element = retval[i]
break
end
end
end
if element == nil then element = modpack_elem end
if element ~= nil then
element.enabled = value ~= "false" and value ~= "nil" and value
else
Expand Down

0 comments on commit 90091fe

Please sign in to comment.