summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua_module_loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/mlua_module_loader.cpp')
-rw-r--r--plugins/MirLua/src/mlua_module_loader.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/MirLua/src/mlua_module_loader.cpp b/plugins/MirLua/src/mlua_module_loader.cpp
index 4e82793a61..a236a76691 100644
--- a/plugins/MirLua/src/mlua_module_loader.cpp
+++ b/plugins/MirLua/src/mlua_module_loader.cpp
@@ -14,9 +14,8 @@ void CLuaModuleLoader::PreloadModule(const char *name, lua_CFunction loader)
void CLuaModuleLoader::LoadModules()
{
- // load core module
- luaopen_m(L);
// regirter delay loading of miranda modules
+ PreloadModule(MLUA_CORE, luaopen_m_core);
PreloadModule(MLUA_CLIST, luaopen_m_clist);
PreloadModule(MLUA_DATABASE, luaopen_m_database);
PreloadModule(MLUA_ICOLIB, luaopen_m_icolib);
@@ -29,6 +28,15 @@ void CLuaModuleLoader::LoadModules()
PreloadModule(MLUA_TOPTOOLBAR, luaopen_m_toptoolbar);
PreloadModule(MLUA_VARIABLES, luaopen_m_variables);
PreloadModule(MLUA_WINDOWS, luaopen_m_windows);
+
+ // load m_core module
+ lua_pushglobaltable(L);
+ lua_getfield(L, -1, "require");
+ lua_pushstring(L, "m_core");
+ if (lua_pcall(L, 1, 1, 0))
+ CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1));
+ lua_pop(L, 1);
+ lua_pop(L, 1);
}
void CLuaModuleLoader::Load(lua_State *L)