From c78be98a7ce94cd701c9f2c79cfa5ac57a883d6b Mon Sep 17 00:00:00 2001 From: pompachomp Date: Tue, 17 Nov 2009 22:11:48 +0000 Subject: [PATCH] Don't print out a comma after the last item displayed. --- AckisRecipeList.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua index a913abc..3526ed0 100644 --- a/AckisRecipeList.lua +++ b/AckisRecipeList.lua @@ -1683,12 +1683,16 @@ function addon:GetTextDump(RecipeDB, profession) -- Add in all the filter flags local recipe_flags = RecipeDB[SpellID]["Flags"] - + local prev + -- Find out which flags are marked as "true" for i = 1, NUM_FLAGS, 1 do - if recipe_flags[i] then - tinsert(text_table, i) - tinsert(text_table, ",") + if recipe_flags[i] then + if prev then + tinsert(text_table, ",") + end + tinsert(text_table, i) + prev = true end end tinsert(text_table, "\",\"") @@ -1720,9 +1724,13 @@ function addon:GetTextDump(RecipeDB, profession) end -- Add all the acquire methods in + prev = false for i in pairs(acquire_list) do - tinsert(text_table, i) - tinsert(text_table, ",") + if prev then + tinsert(text_table, ",") + end + tinsert(text_table, i) + prev = true end if (RecipeDB[SpellID]["Known"]) then -- 1.7.9.5