summaryrefslogtreecommitdiff
path: root/plugins/MirLua/include/mirlua.h
diff options
context:
space:
mode:
authoralitor <me4all@mail.ru>2017-09-26 23:10:43 +0200
committeralitor <me4all@mail.ru>2017-09-26 23:10:43 +0200
commit7f0668bbc54d588b83f06043de455cb7297f7f31 (patch)
treeea96027023baa6dac426bda9cbca65264aeb3b26 /plugins/MirLua/include/mirlua.h
parentf4e6b610a79955bb75d62476d361762e17b791b3 (diff)
parent2258b1b2cf951347d167d01201f0dc4bbf9a4428 (diff)
Merge branch 'master' of https://github.com/miranda-ng/miranda-ng
Diffstat (limited to 'plugins/MirLua/include/mirlua.h')
-rw-r--r--plugins/MirLua/include/mirlua.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/MirLua/include/mirlua.h b/plugins/MirLua/include/mirlua.h
index eee10289bb..6cf96011ff 100644
--- a/plugins/MirLua/include/mirlua.h
+++ b/plugins/MirLua/include/mirlua.h
@@ -14,8 +14,12 @@ __forceinline UINT_PTR luaM_tomparam(lua_State *L, int idx)
case LUA_TLIGHTUSERDATA:
return (UINT_PTR)lua_touserdata(L, idx);
case LUA_TNUMBER:
- if (lua_isinteger(L, idx))
- return (UINT_PTR)lua_tointeger(L, idx);
+ {
+ lua_Integer res = 0;
+ lua_Number num = lua_tonumber(L, idx);
+ if (lua_numbertointeger(num, &res))
+ return res;
+ }
}
return NULL;
}