summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/MirLua/src/mlua_script.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp
index e1adc52ea3..573900cd6d 100644
--- a/plugins/MirLua/src/mlua_script.cpp
+++ b/plugins/MirLua/src/mlua_script.cpp
@@ -50,12 +50,12 @@ bool CMLuaScript::Load()
return false;
}
- if (false) // under construction
- {
- // setting other enviroment to script
- lua_newtable(L);
- lua_setupvalue(L, -2, 1);
- }
+ lua_newtable(L);
+ lua_getglobal(L, "_G");
+ lua_setfield(L, -2, "__index");
+ lua_pushvalue(L, -1);
+ lua_setmetatable(L, -2);
+ lua_setupvalue(L, -2, 1);
if (luaM_pcall(L, 0, 1))
return false;