diff Main.lua @ 57:11fcae12db20

Made the filters actually apply so ALL items are scanned.
author James D. Callahan III <jcallahan@curse.com>
date Tue, 03 Jul 2012 19:44:41 -0500
parents b58277aa11da
children 63f7286e5d13
line wrap: on
line diff
--- a/Main.lua	Tue Jul 03 15:22:51 2012 -0500
+++ b/Main.lua	Tue Jul 03 19:44:41 2012 -0500
@@ -890,13 +890,15 @@
         if unit_type ~= private.UNIT_TYPES.NPC or not unit_idnum then
             return
         end
-        local num_items = _G.GetMerchantNumItems()
         local current_filters = _G.GetMerchantFilter()
         local _, merchant_standing = UnitFactionStanding("target")
         local merchant = NPCEntry(unit_idnum)
         merchant.sells = merchant.sells or {}
 
-        _G.MerchantFrame_SetFilter(nil, _G.LE_LOOT_FILTER_ALL)
+        _G.SetMerchantFilter(_G.LE_LOOT_FILTER_ALL)
+        _G.MerchantFrame_Update()
+
+        local num_items = _G.GetMerchantNumItems()
 
         for item_index = 1, num_items do
             local _, _, copper_price, stack_size, num_available, _, extended_cost = _G.GetMerchantItemInfo(item_index)
@@ -963,7 +965,8 @@
         if _G.CanMerchantRepair() then
             merchant.can_repair = true
         end
-        _G.MerchantFrame_SetFilter(nil, current_filters)
+        _G.SetMerchantFilter(current_filters)
+        _G.MerchantFrame_Update()
     end
 end -- do-block