mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-07-26 10:36:22 +09:00
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:
co-authored by
Claude Opus 4.8
parent
0ead1a51f9
commit
8f6d6e1caa
@@ -155,13 +155,15 @@ local function compute_milestone_rows(force)
|
||||
local rows = {}
|
||||
|
||||
for _, milestone in ipairs(config.milestones) do
|
||||
--- @cast milestone number
|
||||
if milestone <= force_rockets then
|
||||
local time = times[milestone] or 0
|
||||
rows[#rows + 1] = { milestone = milestone, value = time_formats.caption_hours(time), tooltip = time_formats.tooltip_hours(time) }
|
||||
else
|
||||
rows[#rows + 1] = { milestone = milestone, value = { "exp-gui_rocket-info.data-caption-milestone-next" }, tooltip = { "exp-gui_rocket-info.data-tooltip-milestone-next" } }
|
||||
break
|
||||
-- The milestones config mixes the show_milestones flag with the milestone numbers
|
||||
if type(milestone) == "number" then
|
||||
if milestone <= force_rockets then
|
||||
local time = times[milestone] or 0
|
||||
rows[#rows + 1] = { milestone = milestone, value = time_formats.caption_hours(time), tooltip = time_formats.tooltip_hours(time) }
|
||||
else
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user