I have an addon that keeps track of the gold you earned from doing dungeon/raid runs from both direct drops and vendor price, but I've been having multiple reports on Curse of people saying that it only counts the vendor price, not the actual gold dropped by mobs. Other people (and myself) are not experiencing this problem.
To calculate gold drops, I am using the LOOT_OPENED event:
I can't get anybody who reports the bug to respond, but I'm pretty sure the problem stems from my denomination check, if the player using the addon has a language other than English, it will fail.Code:for i=1, GetNumLootItems() do local _, item, quantity = GetLootSlotInfo(i); if (quantity ~= 0) then --Vendor price calculation else for line in item:gmatch("[^\r\n]+") do local number = 0; local denomination = ""; for word in line:gmatch("%w+") do if tonumber(word) ~= nil then number = word; else denomination = word; end end if denomination == 'Gold' then lootedMoney = lootedMoney + (number * 100 * 100); elseif denomination == 'Silver' then lootedMoney = lootedMoney + (number * 100); elseif denomination == 'Copper' then lootedMoney = lootedMoney + number; end end end end
Is there an easier way for me to check for gold looted without worrying about localization settings?