diff --git a/src/controllers/plugins/LuaUtilities.hpp b/src/controllers/plugins/LuaUtilities.hpp index 817b11386..1abb820c3 100644 --- a/src/controllers/plugins/LuaUtilities.hpp +++ b/src/controllers/plugins/LuaUtilities.hpp @@ -148,7 +148,7 @@ bool pop(lua_State *L, T *out, StackIdx idx = -1) { if (idx < 0) { - idx = lua_gettop(L) + idx; + idx = lua_gettop(L) + idx + 1; } lua_remove(L, idx); }