From 38e5290b4e172716f04056d1faf557e2d58d05b1 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 12 Jun 2016 18:05:56 +0000 Subject: MirLua: fix ContactIterator, fix tonumber, added AddEvent function git-svn-id: http://svn.miranda-ng.org/main/trunk@16957 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua_utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 26bcf22657..d3002cb04c 100644 --- a/plugins/MirLua/src/mlua_utils.cpp +++ b/plugins/MirLua/src/mlua_utils.cpp @@ -167,13 +167,19 @@ int luaM_tonumber(lua_State *L) lua_Integer value = (lua_Integer)lua_touserdata(L, 1); lua_pushinteger(L, value); } - else + else if (lua_gettop(L) == 2) { lua_getglobal(L, "_tonumber"); lua_pushvalue(L, 1); lua_pushvalue(L, 2); luaM_pcall(L, 2, 1); } + else + { + lua_getglobal(L, "_tonumber"); + lua_pushvalue(L, 1); + luaM_pcall(L, 1, 1); + } return 1; } -- cgit v1.2.3