mirror of
https://github.com/appgurueu/modlib.git
synced 2024-09-12 00:06:49 +02: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
|
||||
end
|
||||
|
||||
local parent_dir
|
||||
if not minetest then
|
||||
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)
|
||||
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