@@ -226,26 +226,32 @@ eventFrame:RegisterEvent("QUEST_TURNED_IN")
226226eventFrame :SetScript (" OnEvent" , function (self , event , ...)
227227 if event == " QUEST_TURNED_IN" then
228228 local questID = ...
229- local questDB = ME .AllowedDeleteQuestItems or {}
230-
231- for bag = 0 , 4 do
232- local numSlots = GetContainerNumSlots (bag ) or 0
233- for slot = 1 , numSlots do
234- local itemInfo = GetContainerItemInfo (bag , slot )
235- if itemInfo then
236- local itemID = itemInfo .itemID
237- if questDB [itemID ] then
238- for _ , qid in ipairs (questDB [itemID ]) do
239- if qid == questID then
240- ME :Print (ME .COLORS .TEXT .. format (" %s can be now be safely erased!|r" , itemInfo .hyperlink ))
241- break
229+
230+ C_Timer .After (1.0 , function ()
231+ local questDB = ME .AllowedDeleteQuestItems or {}
232+ local alertedItems = {}
233+
234+ for bag = 0 , 4 do
235+ local numSlots = GetContainerNumSlots (bag ) or 0
236+ for slot = 1 , numSlots do
237+ local itemInfo = GetContainerItemInfo (bag , slot )
238+ if itemInfo then
239+ local itemID = itemInfo .itemID
240+
241+ if questDB [itemID ] and not alertedItems [itemID ] then
242+ for _ , qid in ipairs (questDB [itemID ]) do
243+ if qid == questID then
244+ ME :Print (ME .COLORS .TEXT .. format (" %s can be now be safely erased!|r" , itemInfo .hyperlink ))
245+ alertedItems [itemID ] = true
246+ break
247+ end
242248 end
243249 end
244250 end
245251 end
246252 end
247- end
248- ME : UpdateLDB ( )
253+ ME : UpdateLDB ()
254+ end )
249255
250256 elseif event == " PLAYER_LOGIN" then
251257 MagicEraserDB = MagicEraserDB or {}
0 commit comments