comparison Main.lua @ 503:abc372f93293

Updated GetQuestLogRewardCurrencyInfo to use the undocumented 4th return (currency_id).
author MMOSimca <mmosimca@gmail.com>
date Tue, 25 Oct 2016 17:43:45 -0400
parents f64b4ed77b77
children 16498dc5159f
comparison
equal deleted inserted replaced
502:21397b33ba36 503:abc372f93293
1041 1041
1042 -- Create currency rewards sub-table and fill 1042 -- Create currency rewards sub-table and fill
1043 if entry["rewards"]["currency_count"] > 0 then 1043 if entry["rewards"]["currency_count"] > 0 then
1044 entry["rewards"]["currencies"] = {} 1044 entry["rewards"]["currencies"] = {}
1045 for i = 1, entry["rewards"]["currency_count"] do 1045 for i = 1, entry["rewards"]["currency_count"] do
1046 local name, texture_path, quantity = _G.GetQuestLogRewardCurrencyInfo(i, quest_id) 1046 local name, texture_path, quantity, currency_id = _G.GetQuestLogRewardCurrencyInfo(i, quest_id)
1047 local currency_id = CurrencyInfoToID(name, texture_path) 1047 table.insert(entry["rewards"]["currencies"], ("%d:%d"):format(quantity, currency_id))
1048 if currency_id and currency_id ~= 0 then
1049 table.insert(entry["rewards"]["currencies"], ("%d:%d"):format(quantity, currency_id))
1050 end
1051 end 1048 end
1052 end 1049 end
1053 1050
1054 -- Record items 1051 -- Record items
1055 entry["rewards"]["item_count"] = tonumber(_G.GetNumQuestLogRewards(quest_id)) or 0 1052 entry["rewards"]["item_count"] = tonumber(_G.GetNumQuestLogRewards(quest_id)) or 0