Skip to content

Commit

Permalink
feat: handle new reagents bag
Browse files Browse the repository at this point in the history
  • Loading branch information
yad committed Nov 26, 2022
1 parent 7b67170 commit fd5b4b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/LibInit/LibInit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local GetItemInfo=GetItemInfo
local UnitHealth=UnitHealth
local UnitHealthMax=UnitHealthMax
local setmetatable=setmetatable
local NUM_BAG_SLOTS=NUM_BAG_SLOTS
local ALL_PLAYER_NUMBER_BAG_SLOTS=NUM_BAG_SLOTS+1
local InCombatLockdown=InCombatLockdown
local error=error
local tinsert=tinsert
Expand Down Expand Up @@ -633,7 +633,7 @@ end
-- @treturn number Total bag slots
function lib:GetTotalBagSlots()
local i=0
for bag=0,NUM_BAG_SLOTS do
for bag=0,ALL_PLAYER_NUMBER_BAG_SLOTS do
i=i+GetContainerNumSlots(bag)
end
return i
Expand Down Expand Up @@ -662,7 +662,7 @@ function lib:ScanBags(index,value,startbag,startslot)
value=value or 0
startbag=startbag or 0
startslot=startslot or 1
for bag=startbag,NUM_BAG_SLOTS do
for bag=startbag,ALL_PLAYER_NUMBER_BAG_SLOTS do
for slot=startslot,GetContainerNumSlots(bag),1 do
local itemlink=GetContainerItemLink(bag,slot)
if (itemlink) then
Expand Down Expand Up @@ -690,7 +690,7 @@ end
-- @treturn number Total bag slots
function lib:GetBagSlotCount()
local free,total=0,0
for bag=0,NUM_BAG_SLOTS do
for bag=0,ALL_PLAYER_NUMBER_BAG_SLOTS do
free=free+(GetContainerNumFreeSlots(bag) or 0)
total=total+(GetContainerNumSlots(bag) or 0)
end
Expand Down

0 comments on commit fd5b4b0

Please sign in to comment.