Quantcast

Reinstated reagent "learning" at skill learning time, in order to enable key reagent filtering, keyword searching, and other functionality.

pschifferer [02-20-09 - 01:51]
Reinstated reagent "learning" at skill learning time, in order to enable key reagent filtering, keyword searching, and other functionality.
Filename
CauldronTradeskill.lua
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index 79eaac2..42640ce 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -131,27 +131,13 @@ function Cauldron:UpdateSkills()
 					end
 				end

-				-- clear the reagent list
-				skillDB.recipes[name].reagents = {};
-
-	--[[
-				for j=1,GetTradeSkillNumReagents(i) do
-					local rname, rtex, rcount, hasCount = GetTradeSkillReagentInfo(i,j);
-					self:debug("UpdateSkills: rname="..tostring(rname).."; rtex="..tostring(rtex).."; rcount="..tostring(rcount).."; hasCount="..tostring(hasCount));
-
-					if rname then
-						table.insert(skillDB.recipes[name].reagents, {
-							['name'] = rname,
-							['icon'] = rtex,
-							['numRequired'] = rcount,
-							['index'] = j,
-							['skillIndex'] = i,
-						});
-
-						keywords = keywords..","..rname;
-					end
+				-- populate the reagent list
+				Cauldron:GetReagentsForSkill(skillDB.recipes[name]);
+
+				-- update the keyword list for reagents
+				for _,name in ipairs(skillDB.recipes[name].reagents) do
+					keywords = keywords..","..name;
 				end
-	--]]

 				-- fill in the db entry
 				skillDB.recipes[name].keywords = keywords;