diff --git a/Definitions.lua b/Definitions.lua index f8c6c409f..169a7c28e 100644 --- a/Definitions.lua +++ b/Definitions.lua @@ -282,6 +282,8 @@ ---@field PhaseData table ---@field player_last_events table record the latest events of each player, latter used to build the death log ---@field +---@field LockActivityTime fun(self: combat) +---@field CutDeathEventsByTime fun(self: combat, time: number?) remove death events by time, default 10 seconds ---@field GetTotal fun(self: combat, attribute: number, subAttribute: number?, onlyGroup: boolean?) : number return the total amount of the requested attribute ---@field GetCurrentPhase fun(self: combat) : number return the current phase of the combat or the phase where the combat ended ---@field StoreTalents fun(self:combat) diff --git a/classes/class_combat.lua b/classes/class_combat.lua index b577e52e0..82daa2dd5 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -940,19 +940,19 @@ local segmentTypeToString = { end end - function classCombat:CutDeathByTime(time) + function classCombat:CutDeathEventsByTime(time) + time = time or 10 local deathsTable = self:GetDeaths() for i = #deathsTable, 1, -1 do local deathTable = deathsTable[i] local playerName, playerClass, deathTime, deathCombatTime, deathTimeString, playerMaxHealth, deathEvents, lastCooldown, spec = Details:UnpackDeathTable(deathTable) - for evIndex = 1, #deathEvents do + for evIndex = #deathEvents, 1, -1 do local event = deathEvents[evIndex] local evType = event[1] if (type(evType) == "boolean") then local eventTime = event[4] - print(eventTime, deathTime) if (eventTime+10 < deathTime) then - print("this event is ignored, and should be removed", event[1]) + table.remove(deathEvents, evIndex) end end end diff --git a/core/control.lua b/core/control.lua index fb86597b2..821f7d684 100644 --- a/core/control.lua +++ b/core/control.lua @@ -511,6 +511,9 @@ --lock timers currentCombat:LockActivityTime() + --remove death events that are irrelevant for the death log + currentCombat:CutDeathEventsByTime() + --get waste shields if (Details.close_shields) then Details:CloseShields(currentCombat)