Skip to content

Commit

Permalink
Fixed an issue with quest completion detection that was changed for SL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladinator committed Oct 18, 2020
1 parent 6ebff44 commit fb47069
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CandyBuckets.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: CandyBuckets
## Notes: Shows map icons for Lunar Festival, Hallow's End and Midsummer Fire Festival!
## Author: Vladinator
## Version: 9.0.1.201016
## Version: 9.0.1.201018
## X-Curse-Project-ID: 44213
## X-WoWI-ID: 20450
db\hallow.lua
Expand Down
16 changes: 5 additions & 11 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ if WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE then
return
end

local C_Calendar_GetDate = C_Calendar.GetDate or C_DateAndTime.GetCurrentCalendarTime -- TODO: 9.0

local addonName, ns = ...

--
Expand All @@ -24,7 +22,7 @@ ns.PROVIDERS = {}

ns.COMPLETED_QUESTS = setmetatable({}, {
__index = function(self, questID)
local isCompleted = IsQuestFlaggedCompleted(questID)
local isCompleted = C_QuestLog.IsQuestFlaggedCompleted(questID)
if isCompleted then
rawset(self, questID, isCompleted)
end
Expand Down Expand Up @@ -544,7 +542,7 @@ end

function addon:CheckCalendar()
local curHour, curMinute = GetGameTime()
local curDate = C_Calendar_GetDate()
local curDate = C_DateAndTime.GetCurrentCalendarTime()
local calDate = C_Calendar.GetMonthInfo()
local month, day, year = calDate.month, curDate.monthDay, calDate.year
local curMonth, curYear = curDate.month, curDate.year
Expand Down Expand Up @@ -627,7 +625,7 @@ end
function addon:QueryCalendar(check)
local function DelayedUpdate()
if type(CalendarFrame) ~= "table" or not CalendarFrame:IsShown() then
local curDate = C_Calendar_GetDate()
local curDate = C_DateAndTime.GetCurrentCalendarTime()
C_Calendar.SetAbsMonth(curDate.month, curDate.year)
C_Calendar.OpenCalendar()
end
Expand Down Expand Up @@ -784,12 +782,8 @@ function addon:PLAYER_LOGIN(event)
ns.FACTION = 3
end

if GetQuestsCompleted then
GetQuestsCompleted(ns.COMPLETED_QUESTS)
else
for _, id in ipairs(C_QuestLog.GetAllCompletedQuestIDs()) do
ns.COMPLETED_QUESTS[id] = true
end
for _, id in ipairs(C_QuestLog.GetAllCompletedQuestIDs()) do
ns.COMPLETED_QUESTS[id] = true
end

addon:QueryCalendar(true)
Expand Down

0 comments on commit fb47069

Please sign in to comment.