Attempt to fix death log healing spam where a spell has multiple heals in the same second

This commit is contained in:
Tercio Jose
2023-09-05 10:42:40 -03:00
parent 56b5ab7130
commit d208be1fcc
2 changed files with 42 additions and 29 deletions
+1 -1
View File
@@ -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
+41 -28
View File
@@ -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