From 96cd4b6996f7bc0292cc7433aae9af6b4dd9266a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Mon, 5 May 2025 10:29:33 +0200 Subject: [PATCH] Fix intermittent failure to call event handlers The wrong value got duplicated in 87b81ceb45fe, oops. Makes you wonder how the script in the commit message worked at all. --- src/lua/LuaScriptInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 3bddebbfc..2b77e3ed9 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -416,7 +416,7 @@ bool CommandInterface::HandleEvent(const GameControllerEvent &event) { it->Push(L); ++it; - lua_pushvalue(L, 1); + lua_pushvalue(L, -1); int numArgs = pushGameControllerEvent(L, event); int callret = tpt_lua_pcall(L, numArgs, 1, 0, std::visit([](auto &event) { return event.traits;