mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Functions that take a boolean argument now properly type-check for it.
--HG-- branch : minor
This commit is contained in:
@@ -171,6 +171,12 @@ bool luax_toboolean(lua_State *L, int idx)
|
||||
return (lua_toboolean(L, idx) != 0);
|
||||
}
|
||||
|
||||
bool luax_checkboolean(lua_State *L, int idx)
|
||||
{
|
||||
luaL_checktype(L, idx, LUA_TBOOLEAN);
|
||||
return luax_toboolean(L, idx);
|
||||
}
|
||||
|
||||
void luax_pushboolean(lua_State *L, bool b)
|
||||
{
|
||||
lua_pushboolean(L, b ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user