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
+9 -7
View File
@@ -155,13 +155,15 @@ 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 milestone <= force_rockets then if type(milestone) == "number" then
local time = times[milestone] or 0 if milestone <= force_rockets then
rows[#rows + 1] = { milestone = milestone, value = time_formats.caption_hours(time), tooltip = time_formats.tooltip_hours(time) } local time = times[milestone] or 0
else rows[#rows + 1] = { milestone = milestone, value = time_formats.caption_hours(time), tooltip = time_formats.tooltip_hours(time) }
rows[#rows + 1] = { milestone = milestone, value = { "exp-gui_rocket-info.data-caption-milestone-next" }, tooltip = { "exp-gui_rocket-info.data-tooltip-milestone-next" } } else
break rows[#rows + 1] = { milestone = milestone, value = { "exp-gui_rocket-info.data-caption-milestone-next" }, tooltip = { "exp-gui_rocket-info.data-tooltip-milestone-next" } }
break
end
end end
end end