From 8344efdccdee8386b741e066c58bcdc5f9114b7d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 19 Mar 2023 04:59:00 -0700 Subject: [PATCH] Scripting: Return proper callback ID from socket.add --- CHANGES | 1 + src/script/engines/lua.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 99f6c3cd0..1e97b893e 100644 --- a/CHANGES +++ b/CHANGES @@ -24,6 +24,7 @@ Other fixes: - Qt: Fix checked state of mute menu option at load (fixes mgba.io/i/2701) - Scripting: Fix receiving packets for client sockets - Scripting: Fix empty receive calls returning unknown error on Windows + - Scripting: Return proper callback ID from socket.add Misc: - Qt: Include wayland QPA in AppImage (fixes mgba.io/i/2796) - Qt: Stop eating boolean action key events (fixes mgba.io/i/2636) diff --git a/src/script/engines/lua.c b/src/script/engines/lua.c index 98ac95d3f..fdc60f856 100644 --- a/src/script/engines/lua.c +++ b/src/script/engines/lua.c @@ -98,7 +98,7 @@ static const char* _socketLuaSource = " local cbid = self._nextCallback\n" " self._nextCallback = cbid + 1\n" " self._callbacks[event][cbid] = callback\n" - " return id\n" + " return cbid\n" " end,\n" " remove = function(self, cbid)\n" " for _, group in pairs(self._callbacks) do\n"