From 91d468b3215e820923ca51b39ad1a7ed9ce0f301 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Fri, 19 Mar 2010 23:09:51 -0400 Subject: [PATCH] in ProfessionScan(): Sort the recipe list by ID, ascending. --- Datamine.lua | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Datamine.lua b/Datamine.lua index 6d74fc5..54e6839 100644 --- a/Datamine.lua +++ b/Datamine.lua @@ -1363,6 +1363,22 @@ do local recipe_list = {} local output = {} + local function Sort_AscID(a, b) + local reca, recb = private.recipe_list[a], private.recipe_list[b] + + return reca.spell_id < recb.spell_id + end + + local function SortRecipeList() + local sorted_recipes = addon.sorted_recipes + twipe(sorted_recipes) + + for n, v in pairs(recipe_list) do + tinsert(sorted_recipes, n) + end + table.sort(sorted_recipes, Sort_AscID) + end + local function ProfessionScan(prof_name) local master_list = LoadRecipe() @@ -1379,11 +1395,12 @@ do recipe_list[i] = master_list[i] end end + SortRecipeList() twipe(output) -- Parse the entire recipe database - for i in pairs(recipe_list) do - local ttscantext = addon:TooltipScanRecipe(i, false, true) + for index, id in ipairs(addon.sorted_recipes) do + local ttscantext = addon:TooltipScanRecipe(id, false, true) if ttscantext and ttscantext ~= "" then tinsert(output, ttscantext) @@ -1436,21 +1453,6 @@ do local QUAL_STRINGS = private.item_quality_names local V = private.game_version_names - local function Sort_AscID(a, b) - local reca, recb = private.recipe_list[a], private.recipe_list[b] - - return reca.spell_id < recb.spell_id - end - - local function SortRecipeList() - local sorted_recipes = addon.sorted_recipes - twipe(sorted_recipes) - - for n, v in pairs(recipe_list) do - tinsert(sorted_recipes, n) - end - table.sort(sorted_recipes, Sort_AscID) - end local NUM_FILTER_FLAGS = 128 local FUNCTION_FORMATS = { @@ -1751,7 +1753,6 @@ end -- do local scan_data = {} do - --------------------------------------------------------------------------------------------------------- ----This table, DO_NOT_SCAN, contains itemid's that will not cache on the servers --------------------------------------------------------------------------------------------------------- -- 1.7.9.5