diff options
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;
}
|