Skip to content

Commit

Permalink
Fix IsCampaignQuest
Browse files Browse the repository at this point in the history
  • Loading branch information
Neogeekmo committed Aug 13, 2024
1 parent 6126697 commit 58704f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ function AprRC.event.functions.accept(event, questId)
local currentStep = AprRC:GetLastStep()
tinsert(currentStep.PickUp, questId)
else
local step = { PickUp = { questId } }
local IsCampaignQuest = APR:IsCampaignQuest(questId)
step.IsCampaignQuest = IsCampaignQuest and true or nil
local step = { PickUp = { questId }, IsCampaignQuest = AprRC:IsCampaignQuest(questId) or nil }
AprRC:SetStepCoord(step)
AprRC:NewStep(step)
end
Expand Down Expand Up @@ -171,8 +169,7 @@ function AprRC.event.functions.done(event, questId, ...)
tinsert(currentStep.Done, questId)
else
local step = { Done = { questId } }
local IsCampaignQuest = APR:IsCampaignQuest(questId)
step.IsCampaignQuest = IsCampaignQuest and true or nil
step.IsCampaignQuest = AprRC:IsCampaignQuest(questId) or nil
AprRC:SetStepCoord(step)
AprRC:NewStep(step)
end
Expand Down Expand Up @@ -454,8 +451,7 @@ function AprRC.event.functions.qpart(event, questID)
step.InstanceQuest = true
end
setButton(questID, index, step)
local IsCampaignQuest = APR:IsCampaignQuest(questId)
step.IsCampaignQuest = IsCampaignQuest and true or nil
step.IsCampaignQuest = AprRC:IsCampaignQuest(questID) or nil
step.Range = range
AprRC:NewStep(step)
end
Expand Down
6 changes: 6 additions & 0 deletions helper/Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,9 @@ function AprRC:stringToTable(str)
end
end
end

function AprRC:IsCampaignQuest(questID)
local questIndex = C_QuestLog.GetLogIndexForQuestID(questID)
local questInfo = C_QuestLog.GetInfo(questIndex)
return questInfo and questInfo.campaignID ~= nil
end

0 comments on commit 58704f9

Please sign in to comment.