From d37b3e40518af42b6e54b3bda1b432a8f0431427 Mon Sep 17 00:00:00 2001 From: Jesper Frickmann Date: Thu, 30 Dec 2021 04:37:23 -0500 Subject: [PATCH] [lua] Fix Lua Mixer index issue (#1312) * Bug with the index of Mixer script input/output data * Missed a #if defined(COLORLCD) --- radio/src/lua/interface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index 9fa691dc5..587ae6b41 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -148,6 +148,7 @@ static void luaHook(lua_State * L, lua_Debug *ar) #endif // #if defined(LUA_ALLOCATOR_TRACER) } +#if defined(COLORLCD) static void l_pushtableint(const char * key, int value) { lua_pushstring(lsScripts, key); @@ -161,6 +162,7 @@ static void l_pushtablebool(const char * key, bool value) lua_pushboolean(lsScripts, value); lua_settable(lsScripts, -3); } +#endif void luaEmptyEventBuffer() { @@ -933,7 +935,7 @@ static void luaLoadScripts(bool init, const char * filename = nullptr) #if defined(LUA_MODEL_SCRIPTS) // Get input/output tables for mixer scripts if (ref <= SCRIPT_MIX_LAST) { - ScriptInputsOutputs * sio = & scriptInputsOutputs[idx]; + ScriptInputsOutputs * sio = & scriptInputsOutputs[ref - SCRIPT_MIX_FIRST]; lua_getfield(lsScripts, -1, "input"); luaGetInputs(*sio); lua_pop(lsScripts, 1);