The option to remove common segments now also removes trash between raid bosses

This commit is contained in:
Tercio Jose
2023-12-04 20:44:33 -03:00
parent 1c6bf8d2f1
commit 032279bd51
2 changed files with 19 additions and 14 deletions
+7 -3
View File
@@ -764,12 +764,14 @@ end
function segmentClass:ResetDataByCombatType(combatType)
local bIsException = false
local combatTypesInclusion = {}
if (combatType == "m+overall") then
combatType = DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL
bIsException = true
elseif (combatType == "generic") then
combatType = DETAILS_SEGMENTTYPE_GENERIC
combatTypesInclusion[DETAILS_SEGMENTTYPE_GENERIC] = true
combatTypesInclusion[DETAILS_SEGMENTTYPE_RAID_TRASH] = true
end
--if true then return end
@@ -804,7 +806,7 @@ function segmentClass:ResetDataByCombatType(combatType)
for i = #segmentsTable, 2, -1 do
---@type combat
local thisCombatObject = segmentsTable[i]
if (thisCombatObject:GetCombatType() == combatType) then
if (combatTypesInclusion[thisCombatObject:GetCombatType()]) then
---@type boolean, combat|nil
local combatObjectRemoved = table.remove(segmentsTable, i)
if (combatObjectRemoved and combatObjectRemoved == thisCombatObject) then
@@ -952,7 +954,9 @@ function segmentClass:ResetAllCombatData()
end
local successful, errortext = pcall(cleargarbage)
if (not successful) then
Details:Msg("couldn't call collectgarbage()")
if (Details.debug) then
Details:Msg("couldn't call collectgarbage()")
end
end
else
Details.schedule_hard_garbage_collect = true