File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ local addon = select(2, ...)
66local Data = addon .Data
77local Main = addon .Main
88local Checklist = addon .Checklist
9- local Utils = addon .Utils
109local LibDataBroker = LibStub (" LibDataBroker-1.1" )
1110local LibDBIcon = LibStub (" LibDBIcon-1.0" )
1211
@@ -198,23 +197,7 @@ function Core:OnEnable()
198197 -- Re-scan if any profession gear slot returned nil on initial scan due to
199198 -- uncached item data. equipment~=nil means scanned; equipment[i]==nil means
200199 -- slot appeared empty because item data wasn't cached yet.
201- local character = Data :GetCharacter ()
202- if not character then return end
203- local needsRescan = false
204- Utils :TableForEach (character .professions or {}, function (cp )
205- -- Rescan if any slot has a pending sentinel (item data was missing on last scan)
206- -- or if equipment is nil (tool item was uncached so slot group was skipped entirely)
207- if cp .equipment == nil then
208- needsRescan = true
209- else
210- for i = 1 , 3 do
211- if cp .equipment [i ] and cp .equipment [i ].pending then
212- needsRescan = true
213- end
214- end
215- end
216- end )
217- if needsRescan then
200+ if Data :NeedsProfessionEquipmentRescan () then
218201 Data :ScanProfessionEquipment ()
219202 self :Render ()
220203 end
Original file line number Diff line number Diff line change @@ -467,6 +467,20 @@ function Data:ScanAll()
467467 self :ScanProfessionEquipment ()
468468end
469469
470+ --- Returns true if profession equipment should be rescanned.
471+ --- True when any profession has never been scanned (equipment==nil) or has pending slots.
472+ function Data :NeedsProfessionEquipmentRescan ()
473+ local character = self :GetCharacter ()
474+ if not character then return false end
475+ for _ , cp in ipairs (character .professions or {}) do
476+ if cp .equipment == nil then return true end
477+ for i = 1 , 3 do
478+ if cp .equipment [i ] and cp .equipment [i ].pending then return true end
479+ end
480+ end
481+ return false
482+ end
483+
470484--- Scan profession gear slots for the current character and store results in AceDB.
471485function Data :ScanProfessionEquipment ()
472486 if self :IsInChatMessagingLockdown () then return end
You can’t perform that action at this time.
0 commit comments