From b6279f2eae8dbc1520fbf51a6e67eeead06ef75f Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Wed, 17 Mar 2010 23:43:57 -0400 Subject: [PATCH] Modified addon:ScanVendor() to work with the new acquire_data system. --- Datamine.lua | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Datamine.lua b/Datamine.lua index f3e87e8..df49920 100644 --- a/Datamine.lua +++ b/Datamine.lua @@ -1662,16 +1662,26 @@ do if ttscantext then tinsert(output, ttscantext) end - -- Ok now we know it's a vendor, lets check the database to see if the vendor is listed as an acquire method. - local acquire = recipe_list[spell_id]["Acquire"] - local found = false - for i in pairs(acquire) do - local atype = acquire[i].type + -- Check the database to see if the vendor is listed as an acquire method. + local acquire = recipe_list[spell_id]["acquire_data"] + local vendor_data = acquire[A.VENDOR] + local rep_data = acquire[A.REPUTATION] + local found = false - if ((atype == private.acquire_types.VENDOR and acquire[i].ID == targetID) - or (atype == private.acquire_types.REPUTATION and acquire[i].rep_vendor == targetID)) then - found = true + if vendor_data then + for id_num in pairs(vendor_data) do + if id_num == targetID then + found = true + break + end + end + elseif rep_data then + for id_num in pairs(rep_data) do + if id_num == targetID then + found = true + break + end end end -- 1.7.9.5