mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 20:35:17 +03:00
Fixes #3609 - ``background()
`` function in Lua function scripts
This commit is contained in:
parent
0bcd0a0c09
commit
38fdae6f1f
1 changed files with 6 additions and 2 deletions
|
@ -618,11 +618,15 @@ bool luaDoOneRunPermanentScript(uint8_t evt, int i, uint32_t scriptType)
|
|||
}
|
||||
else if ((scriptType & RUN_FUNC_SCRIPT) && (sid.reference >= SCRIPT_FUNC_FIRST && sid.reference <= SCRIPT_FUNC_LAST)) {
|
||||
CustomFunctionData & fn = g_model.customFn[sid.reference-SCRIPT_FUNC_FIRST];
|
||||
if (!getSwitch(fn.swtch)) return false;
|
||||
#if defined(SIMU) || defined(DEBUG)
|
||||
filename = fn.play.name;
|
||||
#endif
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.run);
|
||||
if (getSwitch(fn.swtch))
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.run);
|
||||
else if (sid.background)
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.background);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
#if defined(PCBTARANIS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue