Update init.lua

This commit is contained in:
Rui 2016-11-05 19:29:06 +09:00 committed by GitHub
parent 39d3d1a615
commit 010344e941

@ -5,28 +5,12 @@ local modpath = minetest.get_modpath(modname)
dofile(modpath .. "/api.lua") dofile(modpath .. "/api.lua")
local depends = (function() local modutils = dofile(modpath .. "/modutils.lua")
local file = io.open(modpath .. "/depends.txt") local depmod = modutils.get_depend_checker(modname)
if not file then
return {}
end
local depends = {}
for line in file:lines() do
if line:sub(-1) == "?" then
line = line:sub(1, -2)
end
depends[line] = true
end
file:close()
return depends
end)()
local function filter(name, def) local function filter(name, def)
-- disable carpets from loaded modules but not defined in dependency -- disable carpets from loaded modules but not defined in dependency
if not depends[def.mod_origin] then if not depmod:check_depend(def.mod_origin) then
return false return false
end end