comparison Main.lua @ 195:85c713407c4f 1.0.28

Use "npc" rather than "target" for merchants - hopefully this stops wrongly-recorded information based on race conditions
author James D. Callahan III <jcallahan@curse.com>
date Fri, 30 Nov 2012 12:29:24 -0600
parents 5346ba9b6419
children 45ba0fad1fe4
comparison
equal deleted inserted replaced
194:26e73084ffda 195:85c713407c4f
1618 end 1618 end
1619 1619
1620 1620
1621 function WDP:UpdateMerchantItems(event_name) 1621 function WDP:UpdateMerchantItems(event_name)
1622 if not current_merchant or event_name == "MERCHANT_SHOW" then 1622 if not current_merchant or event_name == "MERCHANT_SHOW" then
1623 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("target")) 1623 local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("npc"))
1624 1624
1625 if not unit_idnum or not UnitTypeIsNPC(unit_type) then 1625 if not unit_idnum or not UnitTypeIsNPC(unit_type) then
1626 return 1626 return
1627 end 1627 end
1628 merchant_standing = select(2, UnitFactionStanding("target")) 1628 merchant_standing = select(2, UnitFactionStanding("npc"))
1629 current_merchant = NPCEntry(unit_idnum) 1629 current_merchant = NPCEntry(unit_idnum)
1630 current_merchant.sells = current_merchant.sells or {} 1630 current_merchant.sells = current_merchant.sells or {}
1631 end 1631 end
1632 local current_filters = _G.GetMerchantFilter() 1632 local current_filters = _G.GetMerchantFilter()
1633 _G.SetMerchantFilter(_G.LE_LOOT_FILTER_ALL) 1633 _G.SetMerchantFilter(_G.LE_LOOT_FILTER_ALL)