# HG changeset patch # User contrebasse # Date 1304012587 -7200 # Node ID 886be292feecde42d4fcf2040091861efa79092f # Parent 578b9c9479c92c500b2697d83e1adefb2565011e Avoid scanning when tradeskill is not fully loaded (no recipe or the first one is not a header) diff -r 578b9c9479c9 -r 886be292feec data.lua --- a/data.lua Thu Apr 28 19:31:01 2011 +0200 +++ b/data.lua Thu Apr 28 19:43:07 2011 +0200 @@ -257,7 +257,14 @@ -- the function who scans the tradeskill function A:ScanSimpleRecipes() - for i = 1,GetNumTradeSkills() do + -- Check if the tradeskill is loaded + -- Has to have recipes and begin with a header + local NRecipes = GetNumTradeSkills() + if NRecipes==0 or select(2,GetTradeSkillInfo(1))~="header" then + return + end + + for i = 2,NRecipes do -- The first one is a header local skillName, skillType, numAvailable, isExpanded, serviceType, numSkillUps = GetTradeSkillInfo(i) if skillType ~= "header" then if GetTradeSkillNumReagents(i) == 1 then @@ -303,5 +310,8 @@ end -- if end -- if end -- for + + -- the scanning is complete + return true end -- function end -- do