diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-07-07 13:49:53 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-07-07 13:49:53 +0000 |
commit | 579b92a2f091284839bfa112116ed088dd3b2418 (patch) | |
tree | bb17a0226477f5aacb2d0caf5e5b1ec01f91342c /plugins/MirLua/src/mlua_utils.cpp | |
parent | a6849e6952b88ca67f2eac3f1e2adc287246b0a5 (diff) |
MirLua:
- added Utf8DecodeA, Utf8DecodeW and Free to m
- more correct number to boolean in m_genmenu
- version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@14505 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_utils.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua_utils.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp index 837ab08c53..6c9bfa2a97 100644 --- a/plugins/MirLua/src/mlua_utils.cpp +++ b/plugins/MirLua/src/mlua_utils.cpp @@ -20,9 +20,10 @@ int luaM_atpanic(lua_State *L) return 0;
}
-bool luaM_checkboolean(lua_State *L, int idx)
+bool luaM_toboolean(lua_State *L, int idx)
{
- luaL_checktype(L, 2, LUA_TBOOLEAN);
+ if (lua_type(L, idx) == LUA_TNUMBER)
+ return lua_tonumber(L, idx) != 0;
return lua_toboolean(L, idx) > 0;
}
|