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