Updated counting of reagents for the skill list.
pschifferer [02-20-09 - 02:07]
Updated counting of reagents for the skill list.
diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua
index 4a2fb31..dadc5b0 100644
--- a/CauldronMainUI.lua
+++ b/CauldronMainUI.lua
@@ -396,7 +396,7 @@ function Cauldron:UpdateSkillList()
SetItemButtonTexture(reagentFrame, reagentInfo.icon);
reagentNameFrame:SetText(reagentInfo.name);
- local playerReagentCount = GetItemCount(reagentInfo.link);
+ local playerReagentCount = GetItemCount(reagentInfo.name);
if playerReagentCount < reagentInfo.numRequired then
-- Grayout items
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index 75ff6e5..3de9107 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -323,11 +323,13 @@ function Cauldron:GetSkillList(playername, skillName)
end
elseif self.db.realm.userdata[playername].skills[skillName].window.filter.haveAnyReagents then
-- check if the reagent count for any reagent is 0
+ local count = 0;
for rname, rinfo in pairs(recipe.reagents) do
-- check possession count
- if GetItemCount(rname) == 0 then
- add = false;
- end
+ count = count + GetItemCount(rname);
+ end
+ if count == 0 then
+ add = false;
end
end
@@ -515,7 +517,7 @@ function Cauldron:GetReagentsForSkill(skillInfo)
end
-- check for the proper trade skill context
- if baseSkillName == skillInfo.tradeskill then
+ if CURRENT_TRADESKILL == skillInfo.tradeskill then
for i=1,GetTradeSkillNumReagents(skillInfo.index) do
local name, icon, count, _ = GetTradeSkillReagentInfo(skillInfo.index, i);