aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/modulemanager.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 4f24c0a1..f160521f 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -406,6 +406,7 @@ function api:require(lib)
f, n = pluginloader.load_code(lib, lib..".lib.lua");
end
if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message
+ setfenv(f, setmetatable({ module = self }, { __index = _G }));
return f();
end