From c99bbd2ef7f9fb2295ff2ec07bb690c4d7351a71 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 21 Oct 2015 18:29:50 +0000 Subject: MirLua: - added totable to cast userdata to metatable - all modules hooks are marked as obsolete - version bumb git-svn-id: http://svn.miranda-ng.org/main/trunk@15586 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/MirLua/src/mlua.cpp') diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index 6da603358d..15bd34fe2d 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -41,6 +41,8 @@ void CMLua::Load() lua_setfield(L, -2, "a"); lua_pushcclosure(L, luaM_toucs2, 0); lua_setfield(L, -2, "u"); + lua_pushcclosure(L, luaM_totable, 0); + lua_setfield(L, -2, "totable"); lua_pop(L, 1); lua_atpanic(L, luaM_atpanic); @@ -135,8 +137,8 @@ int CMLua::HookEventObjParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM par int ref = param; lua_rawgeti(L, LUA_REGISTRYINDEX, ref); - lua_pushnumber(L, wParam); - lua_pushnumber(L, lParam); + lua_pushlightuserdata(L, (void*)wParam); + lua_pushlightuserdata(L, (void*)lParam); if (lua_pcall(L, 2, 1, 0)) CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1)); -- cgit v1.2.3