mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-26 09:13:53 +01:00
Fix undeclared global arg warning
This commit is contained in:
parent
c13beb923b
commit
7253e2837a
5
init.lua
5
init.lua
@ -127,8 +127,11 @@ function loadfile_exports(filename)
|
|||||||
return env
|
return env
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local parent_dir
|
||||||
|
if not minetest then
|
||||||
local init_path = arg and arg[0]
|
local init_path = arg and arg[0]
|
||||||
local parent_dir = init_path and init_path:match"^.[/\\]" or ""
|
parent_dir = init_path and init_path:match"^.[/\\]" or ""
|
||||||
|
end
|
||||||
function load_module(module_name)
|
function load_module(module_name)
|
||||||
local file = module_name .. ".lua"
|
local file = module_name .. ".lua"
|
||||||
return loadfile_exports(minetest and get_resource(modlib.modname, file) or (parent_dir .. file))
|
return loadfile_exports(minetest and get_resource(modlib.modname, file) or (parent_dir .. file))
|
||||||
|
Loading…
Reference in New Issue
Block a user