summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r--plugins/MirLua/src/m_core.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 917694e9e7..ed30486aad 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -185,7 +185,7 @@ static int lua_ReplaceVariables(lua_State *L)
return 1;
}
-luaL_Reg CMLua::coreLib[] =
+luaL_Reg coreApi[] =
{
{ "CreateHookableEvent", lua_CreateHookableEvent },
{ "DestroyHookableEvent", lua_DestroyHookableEvent },
@@ -210,3 +210,13 @@ luaL_Reg CMLua::coreLib[] =
{ NULL, NULL }
};
+
+LUAMOD_API int luaopen_m(lua_State *L)
+{
+ luaL_newlib(L, coreApi);
+ lua_pushlightuserdata(L, NULL);
+ lua_setfield(L, -2, "NULL");
+ lua_setglobal(L, "m");
+
+ return 1;
+} \ No newline at end of file