--------------------------------------------------------------------------------
function get_mods(path,retval,modpack)
+ local mods = core.get_dir_list(path, true)
+
+ for i=1, #mods, 1 do
+ if mods[i]:sub(1,1) ~= "." then
+ local toadd = {}
+ local modpackfile = nil
+
+ toadd.name = mods[i]
+ toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM
+ if modpack ~= nil and
+ modpack ~= "" then
+ toadd.modpack = modpack
+ else
+ local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
+ local error = nil
+ modpackfile,error = io.open(filename,"r")
+ end
- local mods = core.get_dirlist(path,true)
- for i=1,#mods,1 do
- local toadd = {}
- local modpackfile = nil
-
- toadd.name = mods[i]
- toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM
- if modpack ~= nil and
- modpack ~= "" then
- toadd.modpack = modpack
- else
- local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
- local error = nil
- modpackfile,error = io.open(filename,"r")
- end
-
- if modpackfile ~= nil then
- modpackfile:close()
- toadd.is_modpack = true
- table.insert(retval,toadd)
- get_mods(path .. DIR_DELIM .. mods[i],retval,mods[i])
- else
- table.insert(retval,toadd)
+ if modpackfile ~= nil then
+ modpackfile:close()
+ toadd.is_modpack = true
+ table.insert(retval,toadd)
+ get_mods(path .. DIR_DELIM .. mods[i],retval,mods[i])
+ else
+ table.insert(retval,toadd)
+ end
end
end
end
}
end
- local subdirs = core.get_dirlist(temppath,true)
+ local subdirs = core.get_dir_list(temppath, true)
--only single mod or modpack allowed
if #subdirs ~= 1 then
for key,value in pairs(worldfile:to_table()) do
if key == "gameid" then
worldconfig.id = value
- else
+ elseif key:sub(0, 9) == "load_mod_" then
worldconfig.global_mods[key] = core.is_yes(value)
+ else
+ worldconfig[key] = value
end
end