Skip to content

Commit

Permalink
fix: do not wipe overall data unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni committed Jan 29, 2021
1 parent 29a702b commit bb2e9cb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ function DE:CleanDiscardCombat()

remain[combat:GetCombatNumber()] = true
end
if self.overall then
remain[self.overall] = true
end

for key in pairs(self.db) do
if not remain[key] then
Expand Down Expand Up @@ -709,15 +712,20 @@ function DE:OnDetailsEvent(event, combat)
-- end
elseif event == 'DETAILS_DATA_RESET' then
DE:Debug("DETAILS_DATA_RESET")
self.overall = Details:GetCombat(-1):GetCombatNumber()
DE:UpdateOverall()
DE:CleanDiscardCombat()
end
end

function DE:ResetOverall()
self:Debug("on Details Reset Overall (Details.historico.resetar_overall)")
DE:UpdateOverall()
end

function DE:UpdateOverall()
local newOverall = Details:GetCombat(-1):GetCombatNumber()

if self.overall and self.db[self.overall] then
if self.overall and self.overall ~= newOverall and self.db[self.overall] then
self.db[self.overall] = nil
end
self.overall = Details:GetCombat(-1):GetCombatNumber()
Expand Down

0 comments on commit bb2e9cb

Please sign in to comment.