diff options
author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-05-08 09:14:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-08 14:14:14 +0100 |
commit | 54bc8a7627529b1736002a3c942858e0d59ceeba (patch) | |
tree | b6849a26e476176681e07a30fe5136cb620e9f1d | |
parent | 9824a451bb8d6f632aa80abc186f440f8d5a745a (diff) | |
download | minetest-54bc8a7627529b1736002a3c942858e0d59ceeba.tar.gz minetest-54bc8a7627529b1736002a3c942858e0d59ceeba.tar.bz2 minetest-54bc8a7627529b1736002a3c942858e0d59ceeba.zip |
Fix enabling of dependencies with identical names (#12253)
-rw-r--r-- | builtin/mainmenu/pkgmgr.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/mainmenu/pkgmgr.lua b/builtin/mainmenu/pkgmgr.lua index a95fef10b..ce5862ec2 100644 --- a/builtin/mainmenu/pkgmgr.lua +++ b/builtin/mainmenu/pkgmgr.lua @@ -466,11 +466,16 @@ function pkgmgr.enable_mod(this, toset) -- Enable mods' depends after activation - -- Make a list of mod ids indexed by their names + -- Make a list of mod ids indexed by their names. Among mods with the + -- same name, enabled mods take precedence, after which game mods take + -- precedence, being last in the mod list. local mod_ids = {} for id, mod2 in pairs(list) do if mod2.type == "mod" and not mod2.is_modpack then - mod_ids[mod2.name] = id + local prev_id = mod_ids[mod2.name] + if not prev_id or not list[prev_id].enabled then + mod_ids[mod2.name] = id + end end end |