From b421187ad87ac89f2f907e1f3d103f4bf857dac4 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Wed, 17 Mar 2010 23:42:36 -0400 Subject: [PATCH] Modified addon:ScanTrainerData() to work with the new acquire_data system. --- Datamine.lua | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Datamine.lua b/Datamine.lua index d919b0a..f3e87e8 100644 --- a/Datamine.lua +++ b/Datamine.lua @@ -1227,19 +1227,21 @@ do local noteachflag = false for i in pairs(recipe_list) do - local i_name = recipe_list[i].name - local acquire = recipe_list[i]["Acquire"] - local flags = recipe_list[i]["Flags"] + local recipe = recipe_list[i] + local i_name = recipe.name + local acquire = recipe["acquire_data"] + local flags = recipe["Flags"] + + local train_data = acquire[A.TRAINER] - -- If the trainer teaches this recipe if info[i_name] then local found = false - -- Parse acquire info - for j in pairs(acquire) do - if acquire[j].type == private.acquire_types.TRAINER then - if acquire[j].ID == targetID then + if train_data then + for id_num in pairs(train_data) do + if id_num == targetID then found = true + break end end end @@ -1256,10 +1258,11 @@ do else local found = false - for j in pairs(acquire) do - if acquire[j].type == private.acquire_types.TRAINER then - if acquire[j].ID == targetID then + if train_data then + for id_num in pairs(train_data) do + if id_num == targetID then found = true + break end end end -- 1.7.9.5