From d208be1fccd0d54a81bf88da16d9a8daf015208a Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Tue, 5 Sep 2023 10:42:40 -0300 Subject: [PATCH] Attempt to fix death log healing spam where a spell has multiple heals in the same second --- classes/class_utility.lua | 2 +- core/parser.lua | 69 +++++++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/classes/class_utility.lua b/classes/class_utility.lua index f1d5510b..b63c560a 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -260,7 +260,7 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable) gameCooltip:AddStatusBar(healthPercent, 1, barTypeColors.heal, showSpark, statusBarBackgroundTable_ForDeathTooltip) end else - gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|c" .. healingSourceColor .. source .. "|r)", "|c" .. healingAmountColor .. "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|c" .. healingSourceColor .. source .. "|r)", (event[11] and ("x" .. amount .. " ") or ("")) .. "|c" .. healingAmountColor .. "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") gameCooltip:AddIcon(spellIcon, nil, nil, lineHeight, lineHeight, .1, .9, .1, .9) gameCooltip:AddStatusBar(healthPercent, 1, barTypeColors.heal, showSpark, statusBarBackgroundTable_ForDeathTooltip) end diff --git a/core/parser.lua b/core/parser.lua index 547f12f7..3efd27bc 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -2490,46 +2490,59 @@ if (targetActor.grupo) then local t = last_events_cache[targetName] - if (not t) then t = _current_combat:CreateLastEventsTable(targetName) end local i = t.n - local thisEvent = t[i] - - thisEvent[1] = false --true if this is a damage || false for healing - thisEvent[2] = spellId --spellid || false if this is a battle ress line - thisEvent[3] = amount --amount of damage or healing - thisEvent[4] = time --parser time - - --current unit heal - if (targetActor.arena_enemy) then - --this is an arena enemy, get the heal with the unit Id - local unitId = Details.arena_enemies[targetName] - if (not unitId) then - unitId = Details:GuessArenaEnemyUnitId(targetName) + --consolidate if the spellId is the same and the time is the same as well + local previousEvent = t[i-1] + if (previousEvent and previousEvent[2] == spellId and floor(previousEvent[4]) == floor(time)) then + previousEvent[3] = previousEvent[3] + amount + if (absorbed) then + previousEvent[8] = (previousEvent[8] or 0) + absorbed end - if (unitId) then - thisEvent[5] = UnitHealth(unitId) + previousEvent[7] = previousEvent[7] or bIsShield + previousEvent[1] = false --true if this is a damage || false for healing + previousEvent[5] = UnitHealth(targetName) + previousEvent[11] = (previousEvent[11] or 0) + 1 + else + local thisEvent = t[i] + + thisEvent[1] = false --true if this is a damage || false for healing + thisEvent[2] = spellId --spellid || false if this is a battle ress line + thisEvent[3] = amount --amount of damage or healing + thisEvent[4] = time --parser time + thisEvent[11] = nil + + --current unit heal + if (targetActor.arena_enemy) then + --this is an arena enemy, get the heal with the unit Id + local unitId = Details.arena_enemies[targetName] + if (not unitId) then + unitId = Details:GuessArenaEnemyUnitId(targetName) + end + if (unitId) then + thisEvent[5] = UnitHealth(unitId) + else + thisEvent[5] = 0 + end else - thisEvent[5] = 0 + thisEvent[5] = UnitHealth(targetName) end - else - thisEvent[5] = UnitHealth(targetName) - end - thisEvent[6] = sourceName - thisEvent[7] = bIsShield - thisEvent[8] = absorbed + thisEvent[6] = sourceName + thisEvent[7] = bIsShield + thisEvent[8] = absorbed - i = i + 1 + i = i + 1 - if (i == _amount_of_last_events + 1) then - t.n = 1 - else - t.n = i + if (i == _amount_of_last_events + 1) then + t.n = 1 + else + t.n = i + end end end