From 82381040a1946703b78f7f4ddd80e4cada9c2f62 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Sat, 5 Sep 2026 15:39:22 +0200 Subject: [PATCH] Preserve bag cache on targeted invalidation --- Data/BagScanner.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Data/BagScanner.lua b/Data/BagScanner.lua index c681308..b571fce 100644 --- a/Data/BagScanner.lua +++ b/Data/BagScanner.lua @@ -275,12 +275,16 @@ end function BagScanner:InvalidateCache() cacheValid = false + eventPending = true end +-- Existing BagFrame code calls InvalidateBag() frequently. Keep the public API +-- but preserve the cached tables: mark only that bag dirty and refresh it in +-- place on the next GetBagData(). Bag-size changes are detected automatically. function BagScanner:InvalidateBag(bagID) - if not bagCache or not bagCache[bagID] then return end - ReleaseBagCacheData(bagCache[bagID]) - bagCache[bagID] = nil + if bagID == nil then return end + dirtyBags[bagID] = true + eventPending = true end function BagScanner:ScanBags()