mirror of
https://github.com/opentx/opentx.git
synced 2025-07-21 15:25:17 +03:00
The Lua Wizard was broken in 2.0.11
This commit is contained in:
parent
e22c658ee9
commit
f584766fc7
2 changed files with 14 additions and 16 deletions
|
@ -1748,16 +1748,17 @@ void luaError(uint8_t error)
|
||||||
void luaExec(const char *filename)
|
void luaExec(const char *filename)
|
||||||
{
|
{
|
||||||
luaInit();
|
luaInit();
|
||||||
|
if (L) {
|
||||||
standaloneScript.state = SCRIPT_NOFILE;
|
standaloneScript.state = SCRIPT_NOFILE;
|
||||||
int result = luaLoad(filename, standaloneScript);
|
int result = luaLoad(filename, standaloneScript);
|
||||||
// TODO the same with run ...
|
// TODO the same with run ...
|
||||||
if (result == SCRIPT_OK) {
|
if (result == SCRIPT_OK) {
|
||||||
luaState = INTERPRETER_RUNNING_STANDALONE_SCRIPT;
|
luaState = INTERPRETER_RUNNING_STANDALONE_SCRIPT;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
luaError(result);
|
luaError(result);
|
||||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1500,12 +1500,9 @@ enum AUDIO_SOUNDS {
|
||||||
uint8_t outputsCount;
|
uint8_t outputsCount;
|
||||||
ScriptOutput outputs[MAX_SCRIPT_OUTPUTS];
|
ScriptOutput outputs[MAX_SCRIPT_OUTPUTS];
|
||||||
};
|
};
|
||||||
enum InterpreterState {
|
#define INTERPRETER_RUNNING_STANDALONE_SCRIPT 1
|
||||||
INTERPRETER_RUNNING_PERMANENT_SCRIPTS,
|
#define INTERPRETER_RELOAD_PERMANENT_SCRIPTS 2
|
||||||
INTERPRETER_RUNNING_STANDALONE_SCRIPT,
|
#define INTERPRETER_PANIC 255
|
||||||
INTERPRETER_RELOAD_PERMANENT_SCRIPTS,
|
|
||||||
INTERPRETER_PANIC,
|
|
||||||
};
|
|
||||||
extern uint8_t luaState;
|
extern uint8_t luaState;
|
||||||
extern uint8_t luaScriptsCount;
|
extern uint8_t luaScriptsCount;
|
||||||
extern ScriptInternalData standaloneScript;
|
extern ScriptInternalData standaloneScript;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue