mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +00:00
api: fix bagtype detection
This commit is contained in:
+4
-3
@@ -131,19 +131,20 @@ end
|
||||
-- returns: [string] the type of the bag, e.g "QUIVER"
|
||||
function pfUI.api.GetBagFamily(bag)
|
||||
if bag == -2 then return "KEYRING" end
|
||||
if bag == 0 then return "BAG" end
|
||||
|
||||
local _, _, id = strfind(GetInventoryItemLink("player", ContainerIDToInventoryID(bag)) or "", "item:(%d+)")
|
||||
if id then
|
||||
local _, _, _, _, itemType, subType = GetItemInfo(id)
|
||||
local bagtype = L["bagtypes"][itemType]
|
||||
local bagsubtype = L["bagtypes"][subType]
|
||||
|
||||
if bagsubtype == "DEFAULT" then return "BAG" end
|
||||
if bagsubtype == "SOULBAG" then return "SOULBAG" end
|
||||
if bagsubtype == "QUIVER" then return "QUIVER" end
|
||||
if not bagtype and not bagsubtype then return "SPECIAL" end
|
||||
if bagsubtype == nil then return "SPECIAL" end
|
||||
end
|
||||
|
||||
return "BAG"
|
||||
return nil
|
||||
end
|
||||
|
||||
-- [ Abbreviate ]
|
||||
|
||||
Reference in New Issue
Block a user