Introduce c2.later() function to Lua API. (#5154)

This commit is contained in:
Mm2PL
2024-02-25 12:45:59 +01:00
committed by GitHub
parent 101dc82ea0
commit a737d4b755
10 changed files with 128 additions and 2 deletions
+12
View File
@@ -140,6 +140,18 @@ StackIdx push(lua_State *L, const int &b)
return lua_gettop(L);
}
bool peek(lua_State *L, int *out, StackIdx idx)
{
StackGuard guard(L);
if (lua_isnumber(L, idx) == 0)
{
return false;
}
*out = lua_tointeger(L, idx);
return true;
}
bool peek(lua_State *L, bool *out, StackIdx idx)
{
StackGuard guard(L);