From a8f5668d97e32d400fac04192e70550644aedf29 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Sun, 13 Mar 2011 03:37:43 -0500 Subject: [PATCH] Vendor scans which find no recipe that matches the recipe item will attempt to find the correct recipe based on name and set the recipe item id on the recipe. --- Scanner.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Scanner.lua b/Scanner.lua index 3c20401..7ad556c 100644 --- a/Scanner.lua +++ b/Scanner.lua @@ -1096,7 +1096,8 @@ do local match_text = string.match(item_name, "%a+: ") if match_text and RECIPE_TYPES[match_text:lower()] then - local spell_id = RECIPE_ITEM_TO_SPELL_MAP[ItemLinkToID(_G.GetMerchantItemLink(index))] + local item_id = ItemLinkToID(_G.GetMerchantItemLink(index)) + local spell_id = RECIPE_ITEM_TO_SPELL_MAP[item_id] if spell_id then local scanned_text = addon:TooltipScanRecipe(spell_id, true, true) @@ -1169,9 +1170,16 @@ do end end else + for spell_id, recipe in pairs(private.recipe_list) do + local recipe_type, match_text = (":"):split(item_name, 2) + + if recipe.name == match_text:trim() then + recipe:SetRecipeItemID(item_id) + end + end --@debug@ added_output = true - table.insert(output, ("Spell ID not found for: %s"):format(item_name)) + table.insert(output, ("Spell ID not found for recipe item %d (%s)"):format(item_id, item_name)) --@end-debug@ end end -- 1.7.9.5