From adc2cb437e55c022c754564722f05a824b81da0a Mon Sep 17 00:00:00 2001 From: tbkizle Date: Sat, 15 Feb 2020 14:23:59 -0500 Subject: [PATCH] [Baggins-Filtering] Fix Use of AH API recent retail changed api --- Baggins-Filtering.lua | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Baggins-Filtering.lua b/Baggins-Filtering.lua index da52eb7..d6f7c27 100644 --- a/Baggins-Filtering.lua +++ b/Baggins-Filtering.lua @@ -23,8 +23,13 @@ if not Baggins:IsClassicWow() then local GetEquipmentSetInfo, GetEquipmentSetItemIDs, GetNumEquipmentSets = _G.GetEquipmentSetInfo, _G.GetEquipmentSetItemIDs, _G.GetNumEquipmentSets end -local GetItemInfoInstant, GetItemClassInfo, GetItemSubClassInfo, GetAuctionItemSubClasses = - _G.GetItemInfoInstant, _G.GetItemClassInfo, _G.GetItemSubClassInfo, _G.GetAuctionItemSubClasses +local GetItemInfoInstant, GetItemClassInfo, GetItemSubClassInfo = + _G.GetItemInfoInstant, _G.GetItemClassInfo, _G.GetItemSubClassInfo +if Baggins:IsClassicWow() then + GetAuctionItemSubClasses = _G.GetAuctionItemSubClasses +else + GetAuctionItemSubClasses = _G.C_AuctionHouse.GetAuctionItemSubClasses +end local UnitLevel = _G.UnitLevel local C_PetJournal = _G.C_PetJournal local C_Item, ItemLocation = _G.C_Item, _G.ItemLocation @@ -730,9 +735,15 @@ Baggins:AddCustomRule("ItemType", { local tmp = {} tmp.ALL = _G.ALL if rule.itype and ItemTypes[rule.itype] then - for _,k in pairs({GetAuctionItemSubClasses(rule.itype)}) do - tmp[tostring(k)] = GetItemSubClassInfo(rule.itype, k) or UNKNOWN - end + if Baggins:IsClassicWow() then + for _,k in pairs({GetAuctionItemSubClasses(rule.itype)}) do + tmp[tostring(k)] = GetItemSubClassInfo(rule.itype, k) or UNKNOWN + end + else + for _,k in pairs(GetAuctionItemSubClasses(rule.itype)) do + tmp[tostring(k)] = GetItemSubClassInfo(rule.itype, k) or UNKNOWN + end + end end return tmp end,