diff --git a/libraries/AP_Scripting/lua_scripts.cpp b/libraries/AP_Scripting/lua_scripts.cpp index b1b60a29c8a711..98960a11ceba6e 100644 --- a/libraries/AP_Scripting/lua_scripts.cpp +++ b/libraries/AP_Scripting/lua_scripts.cpp @@ -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"); }