From 7a07737379f189172e2a6c48293f082302f28c1b Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 14 Apr 2019 17:31:58 +0200 Subject: [PATCH] api: handle new bag classes introduced in tbc --- api/api.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api/api.lua b/api/api.lua index cbb8b204..6bc1bfd4 100644 --- a/api/api.lua +++ b/api/api.lua @@ -263,7 +263,17 @@ function pfUI.api.GetBagFamily(bag) if bagsubtype == "DEFAULT" then return "BAG" end if bagsubtype == "SOULBAG" then return "SOULBAG" end if bagsubtype == "QUIVER" then return "QUIVER" end - if bagsubtype == nil then return "SPECIAL" end + if bagsubtype == nil and GetContainerNumFreeSlots then + -- handle new bag classes introduced in TBC + local _, subtype = GetContainerNumFreeSlots(bag) + if subtype and subtype > 0 then + return "SPECIAL" + else + return "BAG" + end + elseif bagsubtype == nil then + return "SPECIAL" + end end return nil