v9.8.9: Badlands Trophy quest, 7:XT NPC data, fix AreaId CRITICAL spam
This commit is contained in:
@@ -89,13 +89,10 @@ function QuestEventHandler:RegisterEvents()
|
||||
end
|
||||
|
||||
for questLogIndex = 1, 75 do
|
||||
local title, _, _, isHeader, _, _, _, questId = GetQuestLogTitle(questLogIndex)
|
||||
local title, level, questTag, isHeader, isCollapsed, isComplete, isDaily, questId = GetQuestLogTitle(
|
||||
questLogIndex)
|
||||
|
||||
if (not title) then
|
||||
break
|
||||
end
|
||||
|
||||
if (not isHeader) then
|
||||
if title and questId and (not isHeader) then
|
||||
quest = QuestieDB.GetQuest(questId)
|
||||
|
||||
if quest then
|
||||
@@ -107,7 +104,8 @@ function QuestEventHandler:RegisterEvents()
|
||||
sourceItemId = quest.sourceItemId
|
||||
|
||||
if sourceItemId then
|
||||
soureItemName, _, _, _, _, sourceItemType, _, _, _, _, _, soureClassID = GetItemInfo(sourceItemId)
|
||||
soureItemName, _, _, _, _, sourceItemType, _, _, _, _, _, soureClassID = GetItemInfo(
|
||||
sourceItemId)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -115,7 +113,8 @@ function QuestEventHandler:RegisterEvents()
|
||||
reqSourceItemId = quest.requiredSourceItems[1]
|
||||
|
||||
if reqSourceItemId then
|
||||
reqSoureItemName, _, _, _, _, reqSourceItemType, _, _, _, _, _, reqSoureClassID = GetItemInfo(reqSourceItemId)
|
||||
reqSoureItemName, _, _, _, _, reqSourceItemType, _, _, _, _, _, reqSoureClassID =
|
||||
GetItemInfo(reqSourceItemId)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -154,14 +153,16 @@ function QuestEventHandler:RegisterEvents()
|
||||
end
|
||||
|
||||
if frame ~= nil and text ~= nil then
|
||||
local updateText = l10n("Quest Item %%s might be needed for the quest %%s. \n\nAre you sure you want to delete this?")
|
||||
local updateText = l10n(
|
||||
"Quest Item %%s might be needed for the quest %%s. \n\nAre you sure you want to delete this?")
|
||||
text:SetFormattedText(updateText, text_arg1, questName)
|
||||
text.text_arg1 = updateText
|
||||
|
||||
StaticPopup_Resize(frame, which)
|
||||
deletedQuestItem = true
|
||||
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieQuest] StaticPopup_Show: Quest Item Detected. Updating Static Popup.")
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP,
|
||||
"[QuestieQuest] StaticPopup_Show: Quest Item Detected. Updating Static Popup.")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -170,12 +171,13 @@ function QuestEventHandler:RegisterEvents()
|
||||
hooksecurefunc("DeleteCursorItem", function()
|
||||
-- Hook DeleteCursorItem so we know when the player clicks the Accept button
|
||||
if deletedQuestItem then
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieQuest] DeleteCursorItem: Quest Item deleted. Update all quests.")
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP,
|
||||
"[QuestieQuest] DeleteCursorItem: Quest Item deleted. Update all quests.")
|
||||
|
||||
C_Timer.After(0.25, function()
|
||||
_QuestEventHandler:UpdateAllQuests()
|
||||
deletedQuestItem = false
|
||||
end)
|
||||
_QuestEventHandler:UpdateAllQuests()
|
||||
deletedQuestItem = false
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -187,9 +189,9 @@ function _QuestEventHandler:InitQuestLog()
|
||||
-- Fill the QuestLogCache for first time
|
||||
local cacheMiss, changes = QuestLogCache.CheckForChanges(nil)
|
||||
-- if cacheMiss then
|
||||
-- TODO actually can happen in rare edge case if player accepts new quest during questie init. *cough*
|
||||
-- or if someone managed to overflow game cache already at this point.
|
||||
--Questie:Error("Did you accept a quest during InitQuestLog? Please report on Github or Discord. Game's quest log cache is not ok. This shouldn't happen. Questie may malfunction.")
|
||||
-- TODO actually can happen in rare edge case if player accepts new quest during questie init. *cough*
|
||||
-- or if someone managed to overflow game cache already at this point.
|
||||
--Questie:Error("Did you accept a quest during InitQuestLog? Please report on Github or Discord. Game's quest log cache is not ok. This shouldn't happen. Questie may malfunction.")
|
||||
-- end
|
||||
|
||||
for questId, _ in pairs(changes) do
|
||||
@@ -231,7 +233,7 @@ function _QuestEventHandler:QuestAccepted(questLogIndex, questId)
|
||||
QuestieCombatQueue:Queue(function()
|
||||
QuestieLib:CacheItemNames(questId)
|
||||
_QuestEventHandler:HandleQuestAccepted(questId)
|
||||
QuestieTracker:Update()
|
||||
QuestieTracker:Update()
|
||||
end)
|
||||
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[Quest Event] QUEST_ACCEPTED - skipNextUQLCEvent - ", skipNextUQLCEvent)
|
||||
@@ -240,13 +242,13 @@ end
|
||||
---@param questId number
|
||||
---@return boolean true @if the function was successful, false otherwise
|
||||
function _QuestEventHandler:HandleQuestAccepted(questId)
|
||||
local idx = QuestieCompat.GetQuestLogIndexByID(questId)
|
||||
if not idx then
|
||||
_QuestLogUpdateQueue:Insert(function()
|
||||
return _QuestEventHandler:HandleQuestAccepted(questId)
|
||||
end)
|
||||
return false
|
||||
end
|
||||
local idx = QuestieCompat.GetQuestLogIndexByID(questId)
|
||||
if not idx then
|
||||
_QuestLogUpdateQueue:Insert(function()
|
||||
return _QuestEventHandler:HandleQuestAccepted(questId)
|
||||
end)
|
||||
return false
|
||||
end
|
||||
-- We first check the quest objectives and retry in the next QLU event if they are not correct yet
|
||||
local cacheMiss, changes = QuestLogCache.CheckForChanges({ [questId] = true })
|
||||
if cacheMiss then
|
||||
@@ -272,9 +274,9 @@ function _QuestEventHandler:HandleQuestAccepted(questId)
|
||||
else
|
||||
QuestieQuest:AcceptQuest(questId)
|
||||
end
|
||||
QuestieCompat.C_Timer.After(0.2, function()
|
||||
QuestieTracker:Update()
|
||||
end)
|
||||
QuestieCompat.C_Timer.After(0.2, function()
|
||||
QuestieTracker:Update()
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -301,7 +303,7 @@ function _QuestEventHandler:QuestTurnedIn(questId, xpReward, moneyReward)
|
||||
-- is empty
|
||||
questLog[questId].state = QUEST_LOG_STATES.QUEST_TURNED_IN
|
||||
elseif QuestieCompat.Is335 then
|
||||
questLog[questId] = {state = QUEST_LOG_STATES.QUEST_TURNED_IN}
|
||||
questLog[questId] = { state = QUEST_LOG_STATES.QUEST_TURNED_IN }
|
||||
end
|
||||
|
||||
local parentQuest = QuestieDB.QueryQuestSingle(questId, "parentQuest")
|
||||
@@ -316,7 +318,8 @@ function _QuestEventHandler:QuestTurnedIn(questId, xpReward, moneyReward)
|
||||
local itemName, _, _, quality, _, itemID = GetQuestLogRewardInfo(GetNumQuestLogRewards(questId), questId)
|
||||
|
||||
if (itemID ~= nil or itemName ~= nil) and quality == 1 then
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "Quest:", questId, "Recieved a possible Quest Item - do a full Quest Log check")
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "Quest:", questId,
|
||||
"Recieved a possible Quest Item - do a full Quest Log check")
|
||||
doFullQuestLogScan = true
|
||||
skipNextUQLCEvent = false
|
||||
else
|
||||
@@ -331,11 +334,11 @@ function _QuestEventHandler:QuestTurnedIn(questId, xpReward, moneyReward)
|
||||
-- QuestieQuest:CompleteQuest(questId)
|
||||
-- QuestieJourney:CompleteQuest(questId)
|
||||
-- QuestieAnnounce:CompletedQuest(questId)
|
||||
-- questLog[questId] = nil
|
||||
-- questLog[questId] = nil
|
||||
|
||||
QuestieCombatQueue:Queue(function()
|
||||
QuestieTracker:Update()
|
||||
end)
|
||||
QuestieCombatQueue:Queue(function()
|
||||
QuestieTracker:Update()
|
||||
end)
|
||||
end
|
||||
|
||||
--- Fires when a quest is removed from the quest log. This includes turning it in and abandoning it.
|
||||
@@ -386,7 +389,8 @@ function _QuestEventHandler:MarkQuestAsAbandoned(questId)
|
||||
|
||||
-- so we don't attempt to index a nil value.
|
||||
if (not questEntry) then
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "QuestEventHandler:MarkQuestAsAbandoned - questLog entry missing for", questId)
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "QuestEventHandler:MarkQuestAsAbandoned - questLog entry missing for",
|
||||
questId)
|
||||
return
|
||||
end
|
||||
|
||||
@@ -406,8 +410,8 @@ function _QuestEventHandler:MarkQuestAsAbandoned(questId)
|
||||
|
||||
if (not objectivesWereComplete) and desc and type(desc) == "string" then
|
||||
if string.find(desc, "automatically rewarded") then
|
||||
Questie:Debug(Questie.DEBUG_INFO, "Quest:", questId, "detected as auto-complete by description")
|
||||
objectivesWereComplete = true
|
||||
Questie:Debug(Questie.DEBUG_INFO, "Quest:", questId, "detected as auto-complete by description")
|
||||
objectivesWereComplete = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -415,7 +419,8 @@ function _QuestEventHandler:MarkQuestAsAbandoned(questId)
|
||||
if objectivesWereComplete then
|
||||
-- Objectives were complete, so this was likely an auto-complete quest.
|
||||
-- Mark as complete instead of abandoned so objective pins get hidden.
|
||||
Questie:Debug(Questie.DEBUG_INFO, "Quest:", questId, "objectives were complete - treating as completed (auto-complete quest)")
|
||||
Questie:Debug(Questie.DEBUG_INFO, "Quest:", questId,
|
||||
"objectives were complete - treating as completed (auto-complete quest)")
|
||||
questEntry.state = QUEST_LOG_STATES.QUEST_TURNED_IN
|
||||
|
||||
QuestLogCache.RemoveQuest(questId)
|
||||
@@ -502,14 +507,13 @@ function _QuestEventHandler:UnitQuestLogChanged(unitTarget)
|
||||
skipNextUQLCEvent = false
|
||||
end
|
||||
|
||||
|
||||
-- Fallback cleanup: some servers remove quests without firing QUEST_REMOVED reliably.
|
||||
-- This compares Questie's currentQuestlog vs the game's quest log and removes stale quests.
|
||||
function _QuestEventHandler:CleanupRemovedQuestsFallback()
|
||||
local gameQuestIds = {}
|
||||
local numEntries = select(1, GetNumQuestLogEntries()) or 0
|
||||
for questLogIndex = 1, numEntries do
|
||||
local title, _, _, isHeader, _, _, _, qid = GetQuestLogTitle(questLogIndex)
|
||||
local title, level, questTag, isHeader, isCollapsed, isComplete, isDaily, qid = GetQuestLogTitle(questLogIndex)
|
||||
if title and qid and qid > 0 and (not isHeader) then
|
||||
gameQuestIds[qid] = true
|
||||
end
|
||||
@@ -651,7 +655,7 @@ function _QuestEventHandler:ZoneChangedNewArea()
|
||||
end
|
||||
end)
|
||||
|
||||
-- We only want this to fire outside of an instance if the player isn't dead and we need to reset the Tracker
|
||||
-- We only want this to fire outside of an instance if the player isn't dead and we need to reset the Tracker
|
||||
elseif (not Questie.db.char.isTrackerExpanded and not UnitIsGhost("player")) and trackerMinimizedByDungeon == true then
|
||||
C_Timer.After(8, function()
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[EVENT] ZONE_CHANGED_NEW_AREA: Exiting Instance")
|
||||
|
||||
@@ -10,7 +10,7 @@ local Sounds = QuestieLoader:ImportModule("Sounds")
|
||||
|
||||
--- COMPATIBILITY ---
|
||||
local GetQuestLogTitle = QuestieCompat.GetQuestLogTitle
|
||||
local C_QuestLog_GetQuestObjectives = QuestieCompat.C_QuestLog.GetQuestObjectives
|
||||
local C_QuestLog_GetQuestObjectives = QuestieCompat.C_QuestLog.GetQuestObjectives
|
||||
local HaveQuestData = QuestieCompat.HaveQuestData
|
||||
|
||||
local stringByte = string.byte
|
||||
@@ -53,7 +53,7 @@ local cache = {
|
||||
},
|
||||
[questId2] = ....,
|
||||
}
|
||||
]]--
|
||||
]] --
|
||||
|
||||
|
||||
---@class QuestLogCacheObjectiveData
|
||||
@@ -85,10 +85,10 @@ QuestLogCache.questLog_DO_NOT_MODIFY = cache
|
||||
---@return table? newObjectives, ObjectiveIndex[] changedObjIds @nil == cache miss in both addon and game caches. table {} == no objectives.
|
||||
local function GetNewObjectives(questId, oldObjectives, questLogIndex)
|
||||
local newObjectives = {} -- creating a fresh one to be able revert to old easily in case of missing data
|
||||
local changedObjIds -- not assigning {} for easier nil when nothing changed
|
||||
local changedObjIds -- not assigning {} for easier nil when nothing changed
|
||||
local objectives = C_QuestLog_GetQuestObjectives(questId, questLogIndex)
|
||||
|
||||
for objIndex=1, #objectives do -- iterate manually to be sure getting those in order
|
||||
for objIndex = 1, #objectives do -- iterate manually to be sure getting those in order
|
||||
local oldObj = oldObjectives[objIndex]
|
||||
local newObj = objectives[objIndex]
|
||||
-- Check if objective.text is in game's cache
|
||||
@@ -102,7 +102,7 @@ local function GetNewObjectives(questId, oldObjectives, questLogIndex)
|
||||
if (not changedObjIds) then
|
||||
changedObjIds = { objIndex }
|
||||
else
|
||||
changedObjIds[#changedObjIds+1] = objIndex
|
||||
changedObjIds[#changedObjIds + 1] = objIndex
|
||||
end
|
||||
|
||||
if oldObj and newObj and oldObj.numRequired ~= oldObj.numFulfilled and newObj.numRequired == newObj.numFulfilled then
|
||||
@@ -120,18 +120,22 @@ local function GetNewObjectives(questId, oldObjectives, questLogIndex)
|
||||
type = newObj.type,
|
||||
numRequired = newObj.numRequired,
|
||||
text = QuestieLib.TrimObjectiveText(newObj.text, newObj.type),
|
||||
finished = newObj.finished, -- gets overwritten with correct value later if quest isComplete
|
||||
finished = newObj.finished, -- gets overwritten with correct value later if quest isComplete
|
||||
numFulfilled = newObj.numFulfilled, -- gets overwritten with correct value later if quest isComplete
|
||||
}
|
||||
end
|
||||
else -- objective text not in game's cache
|
||||
if oldObj then
|
||||
Questie:Debug(Questie.DEBUG_INFO, "[GetNewObjectives] objective not in game's cache. Using addon's cache. questID, objIndex:", questId, objIndex)
|
||||
Questie:Debug(Questie.DEBUG_INFO,
|
||||
"[GetNewObjectives] objective not in game's cache. Using addon's cache. questID, objIndex:", questId,
|
||||
objIndex)
|
||||
-- Extremely unlikely that the objective has changed from cached version as a change SHOULD trigger fetching data into game cache.
|
||||
-- Possible bug point if there comes desync issues.
|
||||
newObjectives[objIndex] = oldObj
|
||||
else
|
||||
Questie:Debug(Questie.DEBUG_INFO, "[GetNewObjectives] \"WARNING\" objective not in game's cache nor addon's cache. questID, objIndex:", questId, objIndex)
|
||||
Questie:Debug(Questie.DEBUG_INFO,
|
||||
"[GetNewObjectives] \"WARNING\" objective not in game's cache nor addon's cache. questID, objIndex:",
|
||||
questId, objIndex)
|
||||
-- Objective has been never cached
|
||||
-- Tell to function caller that we couldn't get all required data from game's cache
|
||||
-- Don't loop rest of objectives as we won't anyway save those into cache[] and C_QuestLog.GetQuestObjectives() call already triggered game to initiate caching those into game's cache.
|
||||
@@ -158,7 +162,8 @@ function QuestLogCache.CheckForChanges(questIdsToCheck)
|
||||
|
||||
local numEntries = select(1, GetNumQuestLogEntries()) or 0
|
||||
for questLogIndex = 1, numEntries do
|
||||
local title, _, questTag, isHeader, _, isComplete, _, questId = GetQuestLogTitle(questLogIndex)
|
||||
local title, level, questTag, isHeader, isCollapsed, isComplete, isDaily, questId = GetQuestLogTitle(
|
||||
questLogIndex)
|
||||
|
||||
-- Skip weird/header entries / questId=0 (these happen a lot on your server)
|
||||
if title and questId and questId > 0 and (not isHeader) then
|
||||
@@ -173,8 +178,7 @@ function QuestLogCache.CheckForChanges(questIdsToCheck)
|
||||
|
||||
if newObjectives then
|
||||
if (not cachedQuest) or (#cachedObjectives == #newObjectives and #cachedObjectives > 0 and
|
||||
(cachedQuest.title ~= title or cachedQuest.questTag ~= questTag or cachedQuest.isComplete ~= isComplete)) then
|
||||
|
||||
(cachedQuest.title ~= title or cachedQuest.questTag ~= questTag or cachedQuest.isComplete ~= isComplete)) then
|
||||
changedObjIds = {}
|
||||
for i = 1, #newObjectives do
|
||||
changedObjIds[i] = i
|
||||
@@ -206,7 +210,9 @@ function QuestLogCache.CheckForChanges(questIdsToCheck)
|
||||
cacheMiss = true
|
||||
end
|
||||
else
|
||||
Questie:Debug(Questie.DEBUG_CRITICAL, "[QuestLogCache.CheckForChanges] HaveQuestData() == false. questId, index:", questId, questLogIndex)
|
||||
Questie:Debug(Questie.DEBUG_CRITICAL,
|
||||
"[QuestLogCache.CheckForChanges] HaveQuestData() == false. questId, index:", questId,
|
||||
questLogIndex)
|
||||
C_QuestLog_GetQuestObjectives(questId, questLogIndex)
|
||||
cacheMiss = true
|
||||
end
|
||||
@@ -226,29 +232,24 @@ function QuestLogCache.CheckForChanges(questIdsToCheck)
|
||||
return cacheMiss, changes
|
||||
end
|
||||
|
||||
|
||||
|
||||
function QuestLogCache.RemoveQuest(questId)
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestLogCache.RemoveQuest] remove questId:", questId)
|
||||
cache[questId] = nil
|
||||
end
|
||||
|
||||
|
||||
--- Tests if game client's cache has all quest log quests and objectives cached.
|
||||
--- Avoid using this function if possible.
|
||||
---@return boolean gameCacheOK
|
||||
function QuestLogCache.TestGameCache()
|
||||
local gameCacheOK = true
|
||||
for questLogIndex = 1, MAX_QUEST_LOG_INDEX do
|
||||
local title, _, _, isHeader, _, _, _, questId = GetQuestLogTitle(questLogIndex)
|
||||
if (not title) then
|
||||
break -- We exceeded the valid quest log entries
|
||||
end
|
||||
if (not isHeader) then
|
||||
local title, level, questTag, isHeader, isCollapsed, isComplete, isDaily, questId = GetQuestLogTitle(
|
||||
questLogIndex)
|
||||
if title and questId and (not isHeader) then
|
||||
if HaveQuestData(questId) then
|
||||
local objectives = C_QuestLog_GetQuestObjectives(questId, questLogIndex)
|
||||
|
||||
for objIndex=1, #objectives do
|
||||
for objIndex = 1, #objectives do
|
||||
local text = objectives[objIndex].text
|
||||
-- Check if objective.text is not in game's cache
|
||||
if (not text) or (stringByte(text, 1) == 32) then
|
||||
@@ -261,11 +262,11 @@ function QuestLogCache.TestGameCache()
|
||||
end
|
||||
end
|
||||
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestLogCache.TestGameCache]", (gameCacheOK and "Cache ok." or "Cache missing data."))
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestLogCache.TestGameCache]",
|
||||
(gameCacheOK and "Cache ok." or "Cache missing data."))
|
||||
return gameCacheOK
|
||||
end
|
||||
|
||||
|
||||
--- A wrapper function to add error check instead using exposed table directly.
|
||||
---@param questId QuestId
|
||||
---@return QuestLogCacheData? @NEVER EVER MODIFY THE RETURNED TABLE
|
||||
@@ -292,23 +293,21 @@ function QuestLogCache.GetQuestObjectives(questId)
|
||||
return cache[questId].objectives
|
||||
end
|
||||
|
||||
|
||||
|
||||
---@param q table @quest
|
||||
---@param i number @index of the objective
|
||||
---@param o table @objective
|
||||
local function DebugPrintObjective(q, i, o)
|
||||
if (o.raw_numFulfilled == o.numFulfilled) and (o.raw_finished == o.finished) then
|
||||
print(" ", i.."/"..#q.objectives..":",
|
||||
o.numFulfilled.."/"..o.numRequired.."="..tostring(o.finished),
|
||||
print(" ", i .. "/" .. #q.objectives .. ":",
|
||||
o.numFulfilled .. "/" .. o.numRequired .. "=" .. tostring(o.finished),
|
||||
o.type,
|
||||
"\""..o.raw_text.."\" \""..o.text.."\"")
|
||||
"\"" .. o.raw_text .. "\" \"" .. o.text .. "\"")
|
||||
else
|
||||
print(" ", i.."/"..#q.objectives..":",
|
||||
o.raw_numFulfilled.."/"..o.numRequired.."="..tostring(o.raw_finished),
|
||||
"FIX:", o.numFulfilled.."/"..o.numRequired.."="..tostring(o.finished),
|
||||
print(" ", i .. "/" .. #q.objectives .. ":",
|
||||
o.raw_numFulfilled .. "/" .. o.numRequired .. "=" .. tostring(o.raw_finished),
|
||||
"FIX:", o.numFulfilled .. "/" .. o.numRequired .. "=" .. tostring(o.finished),
|
||||
o.type,
|
||||
"\""..o.raw_text.."\" \""..o.text.."\"")
|
||||
"\"" .. o.raw_text .. "\" \"" .. o.text .. "\"")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -318,7 +317,8 @@ function QuestLogCache.DebugPrintCache()
|
||||
local count = 0
|
||||
for questId, q in pairs(cache) do
|
||||
count = count + 1
|
||||
print("Quest: ("..questId..") \""..q.title.."\" questTag="..tostring(q.questTag) ,"isComplete="..tostring(q.isComplete))
|
||||
print("Quest: (" .. questId .. ") \"" .. q.title .. "\" questTag=" .. tostring(q.questTag),
|
||||
"isComplete=" .. tostring(q.isComplete))
|
||||
if not next(q.objectives) then
|
||||
print(" no objectives")
|
||||
else
|
||||
@@ -332,12 +332,14 @@ end
|
||||
|
||||
--- Debug function, prints changes
|
||||
function QuestLogCache.DebugPrintCacheChanges(cacheMiss, changes)
|
||||
local highlight = ((not cacheMiss) and (not next(changes))) or (cacheMiss and next(changes)) -- highlight untypical cases. they are okey, but sometimes interesting.
|
||||
local highlight = ((not cacheMiss) and (not next(changes))) or
|
||||
(cacheMiss and next(changes)) -- highlight untypical cases. they are okey, but sometimes interesting.
|
||||
print("DebugPrintCacheChanges", GetTime(), (highlight and "\124cffFF4444CacheMiss:\124r" or "CacheMiss"), cacheMiss)
|
||||
|
||||
for questId, objIndexes in pairs(changes) do
|
||||
local q = cache[questId]
|
||||
print("Quest: ("..questId..") \""..q.title.."\" questTag="..tostring(q.questTag) ,"isComplete="..tostring(q.isComplete))
|
||||
print("Quest: (" .. questId .. ") \"" .. q.title .. "\" questTag=" .. tostring(q.questTag),
|
||||
"isComplete=" .. tostring(q.isComplete))
|
||||
if not next(objIndexes) then
|
||||
print(" no objectives changed (or quest doesn't have objectives)")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user