update bags

This commit is contained in:
Bunny67
2018-07-08 10:49:19 +03:00
parent 9f756d4098
commit d8539f81fe
3 changed files with 11 additions and 8 deletions
+1 -5
View File
@@ -449,11 +449,7 @@ function B:Layout(isBank)
end
f.Bags[bagID].numSlots = numSlots
local link = GetInventoryItemLink("player", ContainerIDToInventoryID(bagID))
if link then
local _, _, id = strfind(link, "item:(%d+)")
f.Bags[bagID].type = GetItemFamily(id)
end
f.Bags[bagID].type = GetItemFamily(GetInventoryItemLink("player", ContainerIDToInventoryID(bagID)))
--Hide unused slots
for i = 1, MAX_CONTAINER_ITEMS do
+3 -3
View File
@@ -371,7 +371,7 @@ function B:IsSpecialtyBag(bagID)
local bag = GetInventoryItemLink("player", inventorySlot)
if not bag then return false end
local family = GetItemFamily(match(bag, "item:(%d+)"))
local family = GetItemFamily(bag)
if family == 0 or family == nil then return false end
return family
@@ -379,14 +379,14 @@ end
function B:CanItemGoInBag(bag, slot, targetBag)
local item = bagIDs[B:Encode_BagSlot(bag, slot)]
local itemFamily = GetItemFamily(match(item, "item:(%d+)"))
local itemFamily = GetItemFamily(item)
if itemFamily then
local equipSlot = select(8, GetItemInfo(item))
if equipSlot == "INVTYPE_BAG" then
itemFamily = 1
end
end
local bagFamily = GetItemFamily(match(targetBag, "item:(%d+)"))
local bagFamily = GetItemFamily(targetBag)
if itemFamily then
return (bagFamily == 0) or band(itemFamily, bagFamily) > 0
else