From 2f38a356350b412f25ea5bab75c10070804fa5d3 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Thu, 10 Mar 2011 01:42:48 -0600 Subject: [PATCH] Don't try to get a trainer name and ID before we determine whether or not the NPC _is_ a trainer. --- Scanner.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Scanner.lua b/Scanner.lua index c5bc0d4..12834f8 100644 --- a/Scanner.lua +++ b/Scanner.lua @@ -667,8 +667,6 @@ do end return end - local targetname = _G.UnitName("target") -- Get its name - 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 @@ -708,8 +706,11 @@ do table.wipe(output) -- Dump out trainer info + local trainer_id = tonumber(string.sub(_G.UnitGUID("target"), -12, -9), 16) -- Get the NPC ID + local trainer_name = _G.UnitName("target") -- Get its name + table.insert(output, "ARL Version: @project-version@") - table.insert(output, L["DATAMINER_TRAINER_INFO"]:format(targetname, trainer_id)) + table.insert(output, L["DATAMINER_TRAINER_INFO"]:format(trainer_name, trainer_id)) local teachflag = false local noteachflag = false -- 1.7.9.5