AP_Scripting: only try to load from ROMFS if `HAL_HAVE_AP_ROMFS_EMBEDDED_LUA` is defined

This commit is contained in:
Iampete1 2024-02-24 12:37:32 +00:00 committed by Andrew Tridgell
parent ec762d5609
commit c7d543f9af
1 changed files with 2 additions and 0 deletions

View File

@ -524,10 +524,12 @@ void lua_scripts::run(void) {
load_all_scripts_in_dir(L, SCRIPTING_DIRECTORY);
loaded = true;
}
#ifdef HAL_HAVE_AP_ROMFS_EMBEDDED_LUA
if ((dir_disable & uint16_t(AP_Scripting::SCR_DIR::ROMFS)) == 0) {
load_all_scripts_in_dir(L, "@ROMFS/scripts");
loaded = true;
}
#endif
if (!loaded) {
GCS_SEND_TEXT(MAV_SEVERITY_CRITICAL, "Lua: All directory's disabled see SCR_DIR_DISABLE");
}