From e29fd4d0ead4353ff2e03fcd793400d8e0779481 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 7 Nov 2015 18:42:19 +0000 Subject: MirLua: added metatables wrapper git-svn-id: http://svn.miranda-ng.org/main/trunk@15697 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua_utils.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugins/MirLua/src/mlua_utils.cpp') diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp index 558652ef35..9bfa298cca 100644 --- a/plugins/MirLua/src/mlua_utils.cpp +++ b/plugins/MirLua/src/mlua_utils.cpp @@ -119,10 +119,11 @@ LPARAM luaM_tolparam(lua_State *L, int idx) int luaM_totable(lua_State *L) { - const char *tname = luaL_checkstring(L, -1); + const char *tname = luaL_checkstring(L, 2); - luaL_getmetatable(L, tname); - lua_getfield(L, -1, "__init"); + //luaL_getmetatable(L, tname); + //lua_getfield(L, -1, "__init"); + lua_getglobal(L, tname); lua_pushvalue(L, 1); if (lua_pcall(L, 1, 1, 0)) CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1)); @@ -133,9 +134,7 @@ int luaM_totable(lua_State *L) void ShowNotification(const char *caption, const char *message, int flags, MCONTACT hContact) { if (Miranda_Terminated()) - { return; - } if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) { -- cgit v1.2.3