comparison Main.lua @ 232:4ab275c52d7f

Use "npc" instead of "target" during TRAINER_SHOW so only the correct NPC is attributed.
author James D. Callahan III <jcallahan@curse.com>
date Tue, 12 Feb 2013 13:07:05 -0600
parents 85f113524b19
children 19cd74910fc9
comparison
equal deleted inserted replaced
231:68ddfd7442bf 232:4ab275c52d7f
1992 private.trainer_shown = nil 1992 private.trainer_shown = nil
1993 end 1993 end
1994 1994
1995 1995
1996 function WDP:TRAINER_SHOW(event_name) 1996 function WDP:TRAINER_SHOW(event_name)
1997 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("target")) 1997 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("npc"))
1998 local trainer = NPCEntry(unit_idnum) 1998 local trainer = NPCEntry(unit_idnum)
1999 1999
2000 if not trainer then 2000 if not trainer then
2001 return 2001 return
2002 end 2002 end
2003 local trainer_standing = select(2, UnitFactionStanding("target")) 2003 local trainer_standing = select(2, UnitFactionStanding("npc"))
2004 trainer.teaches = trainer.teaches or {} 2004 trainer.teaches = trainer.teaches or {}
2005 2005
2006 private.trainer_shown = true 2006 private.trainer_shown = true
2007 2007
2008 -- Get the initial trainer filters 2008 -- Get the initial trainer filters