diff options
author | aunsane <aunsane@gmail.com> | 2017-09-26 23:32:12 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-09-26 23:34:06 +0300 |
commit | 2258b1b2cf951347d167d01201f0dc4bbf9a4428 (patch) | |
tree | 1632e76ea7b29da80a24a1c204d5fce932ec5e15 /plugins/MirLua/include/mirlua.h | |
parent | 8756de2ffe2d86c34c8a37f08d68aeeb51b487c3 (diff) |
MirLua: refactoring
- respect metatables in print function
- srmm module functions now return metatable
- version bump
Diffstat (limited to 'plugins/MirLua/include/mirlua.h')
-rw-r--r-- | plugins/MirLua/include/mirlua.h | 8 |
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; } |