From d5d43355875283348961fa15237b3fcbd5a10030 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sat, 11 Feb 2023 12:57:22 +0100 Subject: [PATCH] Experiment --- src/controllers/plugins/LuaUtilities.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/plugins/LuaUtilities.hpp b/src/controllers/plugins/LuaUtilities.hpp index e0ce845d4..817b11386 100644 --- a/src/controllers/plugins/LuaUtilities.hpp +++ b/src/controllers/plugins/LuaUtilities.hpp @@ -146,7 +146,11 @@ bool pop(lua_State *L, T *out, StackIdx idx = -1) auto ok = peek(L, out, idx); if (ok) { - lua_pop(L, 1); + if (idx < 0) + { + idx = lua_gettop(L) + idx; + } + lua_remove(L, idx); } return ok; }