Hey!
I really love this mod and this greatly tidies up the research tree with many mods.
Sadly, in some configurations, object
in collect_difficulties
is nil
. I haven't found the code on GitHub or GitLab, then I would have made a pull request/merge request, so I post the fix here:
in collect_difficulties
(make_dependencies.lua:216) I added a check, if object
is nil
:
local function collect_difficulties(difficulties, object, keys)
if not object then
return {}
end
As this is checked on the function entry, I removed the first recursive check, if object[diff]
is nil.
Would be amazing if you could do a hotfix :)
Thanks!
The complete function now looks like this:
local function collect_difficulties(difficulties, object, keys)
if not object then
return {}
end
if difficulties then
-- we're in data stage and need to handle difficulties
-- try all difficulties, see if we find our expected keys
local defined_difficulties = {}
for diff, _ in pairs(difficulties) do
local ret = collect_difficulties(nil, object[diff], keys)
if ret ~= nil then
table.insert(defined_difficulties, ret[1])
end
end
if #defined_difficulties > 0 then
return defined_difficulties
end
end
-- no need to handle dificulties, or difficulties weren't defined
for _, k in pairs(keys) do
if object[k] ~= nil then
return {object[k]}
end
end
return {}
end