summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scripting/luautil.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/scripting/luautil.h b/src/scripting/luautil.h
index 26ed33c7..f2b76896 100644
--- a/src/scripting/luautil.h
+++ b/src/scripting/luautil.h
@@ -106,6 +106,11 @@ public:
#else
luaL_setfuncs(s, members, 0);
#endif
+
+ // Make the functions table available as a global
+ lua_pushvalue(s, -1); // metatable, "__index", {}, {}
+ lua_setglobal(s, mTypeName); // metatable, "__index", {}
+
lua_rawset(s, -3); // metatable
lua_pop(s, 1); // -empty-
}