fix: dedupe unavailable quest draw logs
This commit is contained in:
@@ -35,6 +35,7 @@ local timer
|
|||||||
|
|
||||||
-- Keep track of all available quests to unload undoable when abandoning a quest
|
-- Keep track of all available quests to unload undoable when abandoning a quest
|
||||||
local availableQuests = {}
|
local availableQuests = {}
|
||||||
|
local unavailableQuestLogged = {}
|
||||||
|
|
||||||
local dungeons = ZoneDB:GetDungeons()
|
local dungeons = ZoneDB:GetDungeons()
|
||||||
|
|
||||||
@@ -283,7 +284,10 @@ _DrawAvailableQuest = function(questId)
|
|||||||
NewThread(function()
|
NewThread(function()
|
||||||
local quest = QuestieDB.GetQuest(questId)
|
local quest = QuestieDB.GetQuest(questId)
|
||||||
if not quest then
|
if not quest then
|
||||||
Questie:Debug(Questie.DEBUG_LEARNER, "[AvailableQuests] Skipping unavailable quest during draw:", questId)
|
if not unavailableQuestLogged[questId] then
|
||||||
|
unavailableQuestLogged[questId] = true
|
||||||
|
Questie:Debug(Questie.DEBUG_LEARNER, "[AvailableQuests] Skipping unavailable quest during draw:", questId)
|
||||||
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if (not quest.tagInfoWasCached) then
|
if (not quest.tagInfoWasCached) then
|
||||||
@@ -292,6 +296,8 @@ _DrawAvailableQuest = function(questId)
|
|||||||
quest.tagInfoWasCached = true
|
quest.tagInfoWasCached = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unavailableQuestLogged[questId] = nil
|
||||||
|
|
||||||
AvailableQuests.DrawAvailableQuest(quest)
|
AvailableQuests.DrawAvailableQuest(quest)
|
||||||
end, 0)
|
end, 0)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ describe("Questie available quests guard", function()
|
|||||||
local content = read("Modules/Quest/AvailableQuests.lua")
|
local content = read("Modules/Quest/AvailableQuests.lua")
|
||||||
assert.is_true(content:find("if not quest then", 1, true) ~= nil)
|
assert.is_true(content:find("if not quest then", 1, true) ~= nil)
|
||||||
assert.is_true(content:find("Skipping unavailable quest during draw", 1, true) ~= nil)
|
assert.is_true(content:find("Skipping unavailable quest during draw", 1, true) ~= nil)
|
||||||
|
assert.is_true(content:find("unavailableQuestLogged[questId]", 1, true) ~= nil)
|
||||||
assert.is_true(content:find("quest.tagInfoWasCached = true", 1, true) ~= nil)
|
assert.is_true(content:find("quest.tagInfoWasCached = true", 1, true) ~= nil)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user