diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-06-12 18:05:56 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-06-12 18:05:56 +0000 |
commit | 38e5290b4e172716f04056d1faf557e2d58d05b1 (patch) | |
tree | 791dfec229f62fe79aeedc4d1fd3c424d9da1e05 /plugins/MirLua/src/mlua_utils.cpp | |
parent | d92aff2ff6b35191b2c32f7f5aaaa62acf37931b (diff) |
MirLua: fix ContactIterator, fix tonumber, added AddEvent function
git-svn-id: http://svn.miranda-ng.org/main/trunk@16957 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_utils.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua_utils.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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;
}
|