diff options
-rw-r--r-- | plugins/MirLua/src/m_core.cpp | 2 | ||||
-rw-r--r-- | plugins/MirLua/src/mlua.cpp | 2 | ||||
-rw-r--r-- | plugins/MirLua/src/mlua.h | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 77dab3299d..e71c20471d 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -206,5 +206,7 @@ luaL_Reg CMLua::coreLib[] = { "Translate", lua_Translate },
{ "ReplaceVariables", lua_ReplaceVariables },
+ { "NULL", NULL },
+
{ NULL, NULL }
};
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index f7b5208ccb..cf3562bedc 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -13,6 +13,8 @@ CMLua::CMLua() : L(NULL) lua_pop(L, 1);
luaL_newlib(L, coreLib);
+ lua_pushlightuserdata(L, NULL); + lua_setfield(L, -2, "NULL");
lua_setglobal(L, "m");
Preload(MLUA_DATABASE, luaopen_m_database);
diff --git a/plugins/MirLua/src/mlua.h b/plugins/MirLua/src/mlua.h index d5a2f0c891..cf1eb7c0fa 100644 --- a/plugins/MirLua/src/mlua.h +++ b/plugins/MirLua/src/mlua.h @@ -5,7 +5,7 @@ class CMLua {
private:
lua_State *L;
- static luaL_Reg coreLib[14];
+ static luaL_Reg coreLib[15];
void Preload(const char *name, lua_CFunction func);
|