summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua_utils.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-12-31 18:38:47 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-12-31 18:38:47 +0000
commit961bf5e6b1ba406951a7624962973bacfe140cd5 (patch)
tree191ca6c8969c381e22c411bab13a2d0216d6dc53 /plugins/MirLua/src/mlua_utils.cpp
parent499ce176a0f552ade6233a7b4f5d1635022f44d1 (diff)
MirLua: added CONTACTINFO metatable
git-svn-id: http://svn.miranda-ng.org/main/trunk@15980 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_utils.cpp')
-rw-r--r--plugins/MirLua/src/mlua_utils.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp
index f8fbae33b8..99bae923d1 100644
--- a/plugins/MirLua/src/mlua_utils.cpp
+++ b/plugins/MirLua/src/mlua_utils.cpp
@@ -138,9 +138,12 @@ int luaM_totable(lua_State *L)
{
const char *tname = luaL_checkstring(L, 2);
- //luaL_getmetatable(L, tname);
- //lua_getfield(L, -1, "__init");
lua_getglobal(L, tname);
+ if (lua_type(L, -1) == LUA_TNIL)
+ {
+ luaL_getmetatable(L, tname);
+ lua_getfield(L, -1, "__init");
+ }
lua_pushvalue(L, 1);
luaM_pcall(L, 1, 1);