Add plugin permissions and IO API (#5231)

This commit is contained in:
Mm2PL
2024-03-09 20:16:25 +01:00
committed by GitHub
parent 2361d30e4b
commit 658fceddaa
16 changed files with 889 additions and 19 deletions
+4 -6
View File
@@ -283,6 +283,7 @@ StackIdx push(lua_State *L, T inp)
/**
* @brief Converts a Lua object into c++ and removes it from the stack.
* If peek fails, the object is still removed from the stack.
*
* Relies on bool peek(lua_State*, T*, StackIdx) existing.
*/
@@ -291,14 +292,11 @@ bool pop(lua_State *L, T *out, StackIdx idx = -1)
{
StackGuard guard(L, -1);
auto ok = peek(L, out, idx);
if (ok)
if (idx < 0)
{
if (idx < 0)
{
idx = lua_gettop(L) + idx + 1;
}
lua_remove(L, idx);
idx = lua_gettop(L) + idx + 1;
}
lua_remove(L, idx);
return ok;
}