AP_Scripting: applets: fix luacheck issues in sport aerobattics and script controller

This commit is contained in:
Iampete1 authored and Peter Hall committed 2025-01-05 14:17:10 +00:00
1 parent 044b4bbcfe
commit 50c45cff75
2 files changed
+15 -36

No files matched your search

@@ -2,7 +2,6 @@
a script to select other lua scripts using an auxillary switch from
/1 /2 or /3 subdirectories of the scripts directory
--]]
-- luacheck: only 0
---@diagnostic disable: param-type-mismatch
@@ -125,7 +124,7 @@ function remove_scripts(subdir)
return false
end
local ret = false
for k,v in ipairs(dlist) do
for _,v in ipairs(dlist) do
local suffix = v:sub(-4)
if compare_strings_ci(suffix,".LUA") and not compare_strings_ci(v,THIS_SCRIPT) then
if not file_exists(subdir .. "/" .. v) then
@@ -148,7 +147,7 @@ function copy_scripts(subdir)
end
local ret = false
local sdir = get_scripts_dir()
for k, v in ipairs(dlist) do
for _, v in ipairs(dlist) do
local suffix = v:sub(-4)
if compare_strings_ci(suffix,".LUA") and not compare_strings_ci(v,THIS_SCRIPT) then
local src = subdir .. "/" .. v
@@ -184,12 +183,11 @@ function mission_load(n)
local index = 0
local fail = false
while true and not fail do
local data = {}
local line = file:read()
if not line then
break
end
local ret, _, seq, curr, frame, cmd, p1, p2, p3, p4, x, y, z, autocont = string.find(line, "^(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+(%d+)")
local ret, _, seq, _--[[ curr ]], frame, cmd, p1, p2, p3, p4, x, y, z, _--[[ autocont ]] = string.find(line, "^(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+([-.%d]+)%s+(%d+)")
if not ret then
fail = true
break