Skip to content

Commit

Permalink
replace GetQuestLogRewardCurrencyInfo with C_QuestLog.GetQuestRewardC…
Browse files Browse the repository at this point in the history
…urrencies
  • Loading branch information
Urtgard committed Jul 26, 2024
1 parent 3b0d8a4 commit 7665b70
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions WQAchievements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1554,19 +1554,27 @@ function WQA:CheckReward(questID, isEmissary, rewardIndex)
end

function WQA:CheckCurrencies(questID, isEmissary)
local numQuestCurrencies = GetNumQuestLogRewardCurrencies(questID)
for i = 1, numQuestCurrencies do
local name, texture, numItems, currencyID = GetQuestLogRewardCurrencyInfo(i, questID)
local questRewardCurrencies = C_QuestLog.GetQuestRewardCurrencies(questID)

for _, currencyInfo in ipairs(questRewardCurrencies) do
local currencyID = currencyInfo.currencyID
local amount = currencyInfo.totalRewardAmount

if self.db.profile.options.reward.currency[currencyID] then
local currency = { currencyID = currencyID, amount = numItems }
local currency = { currencyID = currencyID, amount = amount }
self:AddRewardToQuest(questID, "CURRENCY", currency, isEmissary)
end

-- Reputation Currency
local factionID = ReputationCurrencyList[currencyID] or nil
if factionID then
if self.db.profile.options.reward.reputation[factionID] == true then
local reputation = { name = name, currencyID = currencyID, amount = numItems, factionID = factionID }
local reputation = {
name = currencyInfo.name,
currencyID = currencyID,
amount = amount,
factionID = factionID
}
self:AddRewardToQuest(questID, "REPUTATION", reputation, isEmissary)
end
end
Expand Down

0 comments on commit 7665b70

Please sign in to comment.