From 8ee803c41a67156d6a9e6286e79ea5bdaa2ec292 Mon Sep 17 00:00:00 2001 From: aunsane Date: Sat, 2 Sep 2017 22:38:22 +0300 Subject: MirLua: m_enumerable: added constructor function --- plugins/MirLua/Modules/m_enumerable/src/main.cpp | 3 +++ plugins/MirLua/src/m_database.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/MirLua/Modules/m_enumerable/src/main.cpp b/plugins/MirLua/Modules/m_enumerable/src/main.cpp index 709377f589..b905b18b62 100644 --- a/plugins/MirLua/Modules/m_enumerable/src/main.cpp +++ b/plugins/MirLua/Modules/m_enumerable/src/main.cpp @@ -429,6 +429,9 @@ extern "C" LUAMOD_API int luaopen_m_enumerable(lua_State *L) { luaL_newlib(L, methods); + lua_pushcfunction(L, lua__new); + lua_setglobal(L, MT_ENUMERABLE); + luaL_newmetatable(L, MT_ENUMERABLE); luaL_setfuncs(L, enumerableMeta, 0); lua_pushvalue(L, -1); diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index 9619b36584..0e40c92bee 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -88,7 +88,7 @@ static int db_GetContactInfo(lua_State *L) type = luaL_checkoption(L, 2, NULL, mods) + 1; break; default: - luaL_argerror(L, 1, luaL_typename(L, 2)); + luaL_argerror(L, 2, luaL_typename(L, 2)); } ptrW value(Contact_GetInfo(type, hContact)); -- cgit v1.2.3