Fixing error during parse of tracked quests
Leandro Silva [09-30-18 - 00:16]
Fixing error during parse of tracked quests
diff --git a/LeoAltholic.lua b/LeoAltholic.lua
index 1ac076c..f0a101b 100644
--- a/LeoAltholic.lua
+++ b/LeoAltholic.lua
@@ -2,7 +2,7 @@
LeoAltholic = {}
LeoAltholic.name = "LeoAltholic"
LeoAltholic.displayName = "Leo's Altholic"
-LeoAltholic.version = "1.1.0"
+LeoAltholic.version = "1.1.1"
LeoAltholic.chatPrefix = "|c39B027" .. LeoAltholic.name .. "|r: "
LeoAltholic.timerQueue = {}
diff --git a/LeoAltholic.txt b/LeoAltholic.txt
index a087d88..f4aa1c9 100644
--- a/LeoAltholic.txt
+++ b/LeoAltholic.txt
@@ -1,6 +1,6 @@
## Title: Leo's Altholic
## APIVersion: 100024 100025
-## Version: 1.1.0
+## Version: 1.1.1
## Author: |c39B027@LeandroSilva|r
## SavedVariables: LeoAltholicSavedVariables
## DependsOn: LibStub LibFeedback
diff --git a/LeoAltholicUI.lua b/LeoAltholicUI.lua
index 253610d..ddaf4ef 100644
--- a/LeoAltholicUI.lua
+++ b/LeoAltholicUI.lua
@@ -417,27 +417,29 @@ function LeoAltholic.DisplayCharacterFrames()
control:SetText(char.champion[dAttribute].disciplines[i].spent)
end
- row = WINDOW_MANAGER:GetControlByName('LeoAltholicTrackedRow'..x)
- for i = 1, 10 do
- local label = row:GetNamedChild("Quest" .. i .. "Label")
- local done = row:GetNamedChild("Quest" .. i .. "Done")
- if char.quests.tracked[i] ~= nil then
- label:SetText(char.quests.tracked[i].name)
- if char.quests.tracked[i].lastDone ~= nil then
- if char.quests.tracked[i].lastDone <= LeoAltholic.todayReset() then
- done:SetText("|cCB110Enot done today|r")
- else
- local diff = GetTimeStamp() - char.quests.tracked[i].lastDone
- if diff < 3600 then
- done:SetText(zo_strformat("<<1[%d minute ago/%d minutes ago]>>", math.floor(diff / 60)))
- elseif diff < 86400 then
- done:SetText(zo_strformat("<<1[%d hour ago/%d hours ago]>>", math.floor(diff / 3600)))
+ if char.quests.tracked ~= nil then
+ row = WINDOW_MANAGER:GetControlByName('LeoAltholicTrackedRow'..x)
+ for i = 1, 10 do
+ local label = row:GetNamedChild("Quest" .. i .. "Label")
+ local done = row:GetNamedChild("Quest" .. i .. "Done")
+ if char.quests.tracked[i] ~= nil then
+ label:SetText(char.quests.tracked[i].name)
+ if char.quests.tracked[i].lastDone ~= nil then
+ if char.quests.tracked[i].lastDone <= LeoAltholic.todayReset() then
+ done:SetText("|cCB110Enot done today|r")
else
- done:SetText(zo_strformat("<<1[Yesterday/%d days ago]>>", math.floor(diff / 86400)))
+ local diff = GetTimeStamp() - char.quests.tracked[i].lastDone
+ if diff < 3600 then
+ done:SetText(zo_strformat("<<1[%d minute ago/%d minutes ago]>>", math.floor(diff / 60)))
+ elseif diff < 86400 then
+ done:SetText(zo_strformat("<<1[%d hour ago/%d hours ago]>>", math.floor(diff / 3600)))
+ else
+ done:SetText(zo_strformat("<<1[Yesterday/%d days ago]>>", math.floor(diff / 86400)))
+ end
end
+ else
+ done:SetText("|cCB110Enot done today|r")
end
- else
- done:SetText("|cCB110Enot done today|r")
end
end
end