From df4449730b30b83fc4b11311277015dddeedf6f4 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Mon, 12 Apr 2010 04:00:02 -0400 Subject: [PATCH 1/3] In Player:HasProperRepLevel() - fixed logic to return the correct values for reputations which aren't stored. --- Player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Player.lua b/Player.lua index 84121de..b02ae6d 100644 --- a/Player.lua +++ b/Player.lua @@ -107,7 +107,7 @@ function Player:HasProperRepLevel(rep_data) end local rep_name = private.reputation_list[rep_id].name - if player_rep[rep_name] and player_rep[rep_name] < rep_level then + if not player_rep[rep_name] or player_rep[rep_name] < rep_level then has_faction = false else has_faction = true -- 1.7.9.5 From 867170edf543a9fe10502ac49bf267e831fb5cab Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Tue, 13 Apr 2010 22:55:34 -0400 Subject: [PATCH 2/3] In addon:ScanTrainerData(): Fixed output logic. --- Scanner.lua | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Scanner.lua b/Scanner.lua index 115cdd3..dec29ce 100644 --- a/Scanner.lua +++ b/Scanner.lua @@ -714,9 +714,7 @@ do local teachflag = false local noteachflag = false - for i in pairs(recipe_list) do - local recipe = recipe_list[i] - local i_name = recipe.name + for spell_id, recipe in pairs(recipe_list) do local train_data = recipe.acquire_data[A.TRAINER] local found = false @@ -729,16 +727,20 @@ do end end - if info[i_name] and not found then - tinsert(teach, i) - teachflag = true + if info[recipe.name] then + if not found then + tinsert(teach, spell_id) + teachflag = true - if not recipe:IsFlagged("common1", "TRAINER") then - tinsert(output, ": Trainer flag needs to be set.") + if not recipe:IsFlagged("common1", "TRAINER") then + tinsert(output, ": Trainer flag needs to be set.") + end + end + else + if found then + noteachflag = true + tinsert(noteach, spell_id) end - elseif found then - noteachflag = true - tinsert(noteach, i) end end -- 1.7.9.5 From 6ddf11fb6d4b8500408f576478e0fe9cbddf2268 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Tue, 13 Apr 2010 23:49:41 -0400 Subject: [PATCH 3/3] Moved trainer-only recipe check from addon:PrintScanResults() to addon:TooltipScanRecipe(), since recipes with no item never reach the former function. --- Scanner.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Scanner.lua b/Scanner.lua index dec29ce..748cf08 100644 --- a/Scanner.lua +++ b/Scanner.lua @@ -1412,10 +1412,16 @@ do elseif not item_id then -- We are dealing with a recipe that does not have an item to learn it from. -- Lets check the recipe flags to see if we have a data error and the item should exist - if not recipe:IsFlagged("common1", "RETIRED") - and (recipe:IsFlagged("common1", "VENDOR") or recipe:IsFlagged("common1", "INSTANCE") or recipe:IsFlagged("common1", "RAID")) then + if not recipe:IsFlagged("common1", "RETIRED") then + if (recipe:IsFlagged("common1", "VENDOR") or recipe:IsFlagged("common1", "INSTANCE") or recipe:IsFlagged("common1", "RAID")) then tinsert(output, string.format("%s: %d", recipe.name, spell_id)) tinsert(output, " No match found in the SPELL_TO_RECIPE_MAP table.") + elseif recipe:IsFlagged("common1", "TRAINER") and recipe.quality ~= private.item_qualities["COMMON"] then + local QS = private.item_quality_names + + tinsert(output, string.format("%s: %d", recipe.name, spell_id)) + tinsert(output, string.format(" Wrong quality: Q.%s - should be Q.COMMON.", QS[recipe.quality])) + end end end ARLDatamineTT:Hide() @@ -1983,12 +1989,7 @@ do tinsert(output, string.format(" Extra Specialty: %s", recipe.specialty)) end - if recipe:IsFlagged("common1", "TRAINER") and not SPELL_TO_RECIPE_MAP[recipe.spell_id] and recipe.quality ~= private.item_qualities["COMMON"] then - local QS = private.item_quality_names - - found_problem = true - tinsert(output, string.format(" Wrong quality: Q.%s - should be Q.COMMON.", QS[recipe.quality])) - elseif scan_data.quality ~= recipe.quality then + if scan_data.quality ~= recipe.quality then local QS = private.item_quality_names found_problem = true -- 1.7.9.5