From b50826bc74ee627849d10eb2b6267b0361e8edae Mon Sep 17 00:00:00 2001 From: Kilrah Date: Sat, 14 Jul 2018 13:21:24 +0200 Subject: [PATCH] Do not load global function scripts if global functions are disabled in model settings (fix #6029) --- radio/src/lua/interface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index d16c3658c..513d0ce8e 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -633,6 +633,9 @@ bool luaLoadMixScript(uint8_t index) bool luaLoadFunctionScript(uint8_t index, uint8_t ref) { + if ((ref >= SCRIPT_GFUNC_FIRST) && g_model.noGlobalFunctions) + return false; + CustomFunctionData & fn = (ref < SCRIPT_GFUNC_FIRST ? g_model.customFn[index] : g_eeGeneral.customFn[index]); if (fn.func == FUNC_PLAY_SCRIPT && ZEXIST(fn.play.name)) {