From e587b2e846f9e0b8b2abf51971b39c9231b47728 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Sun, 21 Mar 2010 03:11:59 -0400 Subject: [PATCH] Re-wrote Sort_Location() for private.location_list --- Frame.lua | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Frame.lua b/Frame.lua index 1cc38a2..3377a4d 100644 --- a/Frame.lua +++ b/Frame.lua @@ -414,21 +414,6 @@ do end local RECIPE_SORT_FUNCS = { - local function Sort_Location(a, b) - -- We do the or "" because of nil's, I think this would be better if I just left it as a table which was returned - local reca = recipe_list[a].locations or "" - local recb = recipe_list[b].locations or "" - - reca = smatch(reca,"(%w+), ") or reca - recb = smatch(recb,"(%w+), ") or recb - - if reca == recb then - return Sort_Acquisition(a, b) - else - return reca < recb - end - end - ["SkillAsc"] = Sort_SkillAsc, ["SkillDesc"] = Sort_SkillDesc, ["Name"] = Sort_Name, @@ -450,6 +435,14 @@ do end table.sort(sorted_recipes, sort_func) end + + local function Sort_Location(a, b) + local loc_a = location_list[a] + local loc_b = location_list[b] + + return loc_a.name < loc_b.name + end + end -- do ------------------------------------------------------------------------------- -- 1.7.9.5