diff --git a/RatingBuster.lua b/RatingBuster.lua index 691ae4f..572b5b5 100644 --- a/RatingBuster.lua +++ b/RatingBuster.lua @@ -2767,9 +2767,11 @@ function RatingBuster:StatSummary(tooltip, name, link) else id = StatLogic:GetDiffID(link, profileDB.sumIgnoreEnchant, profileDB.sumIgnoreGems, red, yellow, blue, meta) end + + local numLines = tooltip:NumLines() -- Check Cache - if cache[id] then + if cache[id] and cache[id].numLines == numLines then if table.maxn(cache[id]) == 0 then return end -- Write Tooltip if profileDB.sumBlankLine then @@ -2929,6 +2931,7 @@ function RatingBuster:StatSummary(tooltip, name, link) ------------------------ -- Build Output Table -- local output = {} + output.numLines = numLines for _, t in ipairs(summary) do local n, s, d1, d2, ispercent = t.name, t.sum, t.diff1, t.diff2, t.ispercent local right, left diff --git a/libs/StatLogic-1.0/StatLogic-1.0.lua b/libs/StatLogic-1.0/StatLogic-1.0.lua index efdf969..183783a 100644 --- a/libs/StatLogic-1.0/StatLogic-1.0.lua +++ b/libs/StatLogic-1.0/StatLogic-1.0.lua @@ -4144,8 +4144,13 @@ function StatLogic:GetSum(item, table) table = table or new() setmetatable(table, statTableMetatable) + tip:ClearLines() -- this is required or SetX won't work the second time its called + tip:SetHyperlink(link) + + local numLines = tip:NumLines() + -- Get data from cache if available - if cache[link] then + if cache[link] and cache[link].numLines == numLines then copyTable(table, cache[link]) return table end @@ -4153,6 +4158,7 @@ function StatLogic:GetSum(item, table) -- Set metadata table.itemType = itemType table.link = link + table.numLines = numLines -- Don't scan Relics because they don't have general stats if itemType == "INVTYPE_RELIC" then @@ -4161,8 +4167,6 @@ function StatLogic:GetSum(item, table) end -- Start parsing - tip:ClearLines() -- this is required or SetX won't work the second time its called - tip:SetHyperlink(link) print(link) for i = 2, tip:NumLines() do local text = tip[i]:GetText()