removed duplicate warnings (#29)

* removed duplicate warnings
This commit is contained in:
2025-05-09 13:33:15 +02:00
committed by GitHub
parent 69833980fc
commit 880816193d
4 changed files with 55 additions and 64 deletions
+18 -1
View File
@@ -208,6 +208,9 @@ GlobalStageManager.printFullOverview = function ()
local logger = Spearhead.LoggerTemplate.new("StageOverview", "INFO")
logger:info("Stage overview:")
local max = 0
local lines = {}
for stageIndex, stages in pairs(StagesByIndex) do
local totalStrike = 0
@@ -224,9 +227,23 @@ GlobalStageManager.printFullOverview = function ()
totaldead = totaldead + dead
totalMissions = totalMissions + strike + dead + bai
end
logger:info("Stage# " .. tostring(stageIndex).. " | " .. totalStrike .. " strikes | " .. totaldead .. " dead | " .. totalbai .. " BAI | Total:" .. totalMissions)
local index = tonumber(stageIndex)
if index then
if index > max then
max = index
end
lines[index] ="Stage# " .. tostring(stageIndex).. " | " .. totalStrike .. " strikes | " .. totaldead .. " dead | " .. totalbai .. " BAI | Total:" .. totalMissions
else
logger:warn("Stage index is not a number: " .. stageIndex)
end
end
for i = 1, max do
if lines[i] then
logger:info(lines[i])
end
end
end