From 9a977b63cbdbf0837426ce093fc5433973fbc634 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Sun, 6 Mar 2011 12:00:05 -0600 Subject: [PATCH] If the trainer datamine scan detects skills we don't show the trainer as knowing, fix our data. Also set the trainer filter on the recipe if necessary. --- Scanner.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Scanner.lua b/Scanner.lua index 3c026d0..c473ec5 100644 --- a/Scanner.lua +++ b/Scanner.lua @@ -668,7 +668,7 @@ do return end local targetname = _G.UnitName("target") -- Get its name - local targetID = tonumber(string.sub(_G.UnitGUID("target"), -12, -9), 16) -- Get the NPC ID + local trainer_id = tonumber(string.sub(_G.UnitGUID("target"), -12, -9), 16) -- Get the NPC ID if not _G.IsTradeskillTrainer() then -- Are we at a trade skill trainer? if not autoscan then @@ -709,7 +709,7 @@ do -- Dump out trainer info table.insert(output, "ARL Version: @project-version@") - table.insert(output, L["DATAMINER_TRAINER_INFO"]:format(targetname, targetID)) + table.insert(output, L["DATAMINER_TRAINER_INFO"]:format(targetname, trainer_id)) local teachflag = false local noteachflag = false @@ -720,7 +720,7 @@ do if train_data then for id_num in pairs(train_data) do - if id_num == targetID then + if id_num == trainer_id then found = true break end @@ -729,10 +729,12 @@ do if info[recipe.name] then if not found then + recipe:AddTrainer(trainer_id) table.insert(teach, spell_id) teachflag = true if not recipe:IsFlagged("common1", "TRAINER") then + recipe:AddFilters(F.TRAINER) table.insert(output, spell_id..": Trainer flag needs to be set.") end end -- 1.7.9.5