Fix milestone lint warning in rocket info gui

Narrow the milestone loop variable with a type check instead of an
@cast, which tripped cast-type-mismatch because the milestones config
mixes the show_milestones flag in with the numbers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-06-19 20:05:48 +00:00
co-authored by Claude Opus 4.8
parent 0ead1a51f9
commit 8f6d6e1caa
+3 -1
View File
@@ -155,7 +155,8 @@ local function compute_milestone_rows(force)
local rows = {} local rows = {}
for _, milestone in ipairs(config.milestones) do for _, milestone in ipairs(config.milestones) do
--- @cast milestone number -- The milestones config mixes the show_milestones flag with the milestone numbers
if type(milestone) == "number" then
if milestone <= force_rockets then if milestone <= force_rockets then
local time = times[milestone] or 0 local time = times[milestone] or 0
rows[#rows + 1] = { milestone = milestone, value = time_formats.caption_hours(time), tooltip = time_formats.tooltip_hours(time) } rows[#rows + 1] = { milestone = milestone, value = time_formats.caption_hours(time), tooltip = time_formats.tooltip_hours(time) }
@@ -164,6 +165,7 @@ local function compute_milestone_rows(force)
break break
end end
end end
end
return rows return rows
end end