summaryrefslogtreecommitdiff
path: root/plugins/MirLua/include
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/include')
-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;
}