mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
world.mt: Only accept true/false/nil values (#8055)
This patch will make distinguishable mods in modpacks possible in the future `nil` checks are required to provide backwards-compatibility for fresh configured worlds
This commit is contained in:
@@ -391,7 +391,10 @@ function pkgmgr.get_worldconfig(worldpath)
|
||||
if key == "gameid" then
|
||||
worldconfig.id = value
|
||||
elseif key:sub(0, 9) == "load_mod_" then
|
||||
worldconfig.global_mods[key] = core.is_yes(value)
|
||||
-- Compatibility: Check against "nil" which was erroneously used
|
||||
-- as value for fresh configured worlds
|
||||
worldconfig.global_mods[key] = value ~= "false" and value ~= "nil"
|
||||
and value
|
||||
else
|
||||
worldconfig[key] = value
|
||||
end
|
||||
@@ -595,7 +598,7 @@ function pkgmgr.preparemodlist(data)
|
||||
end
|
||||
end
|
||||
if element ~= nil then
|
||||
element.enabled = core.is_yes(value)
|
||||
element.enabled = value ~= "false" and value ~= "nil" and value
|
||||
else
|
||||
core.log("info", "Mod: " .. key .. " " .. dump(value) .. " but not found")
|
||||
end
|
||||
|
Reference in New Issue
Block a user