Skip to content

Instantly share code, notes, and snippets.

@tywtyw2002
Created September 24, 2022 23:20
Show Gist options
  • Save tywtyw2002/05bde78cffdf59218c7e1c595c3fff07 to your computer and use it in GitHub Desktop.
Save tywtyw2002/05bde78cffdf59218c7e1c595c3fff07 to your computer and use it in GitHub Desktop.
--- QuestLog.lua 2022-09-20 11:47:48.000000000 -0600
+++ QuestLog.lua 2022-09-24 17:13:12.000000000 -0600
@@ -44,6 +44,25 @@
end
end
+local function CleanZombieQuests()
+ local numEntries, _ = GetNumQuestLogEntries()
+ if KT_GetNumQuestWatches() > 0 then
+ local questIds = {}
+ for i=1, numEntries do
+ local _, _, _, isHeader, _, _, _, questID, _, _, _, _, isTask, isBounty = GetQuestLogTitle(i)
+ if not isHeader and not isTask and not isBounty then
+ questIds[questID] = true
+ end
+ end
+ -- do clean
+ for k, quest in ipairs(dbChar.trackedQuests) do
+ if not questIds[quest.id] then
+ tremove(dbChar.trackedQuests, k)
+ end
+ end
+ end
+end
+
local function SetHooks()
-- Quest Log -------------------------------------------------------------------------------------------------------
@@ -125,6 +144,7 @@
_DBG("|cffffff00Init|r - "..self:GetName(), true)
db = KT.db.profile
dbChar = KT.db.char
+ CleanZombieQuests()
end
function M:OnEnable()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment