Skip to content

Commit

Permalink
Restack items by itemlink not by name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed Jul 14, 2019
1 parent f25ed81 commit ac8f852
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ShestakUI/Modules/Blizzard/Bags.lua
Expand Up @@ -54,7 +54,7 @@ for k = 0, 11 do
subs[k + 1] = GetItemSubClassInfo(LE_ITEM_CLASS_ARMOR, k) subs[k + 1] = GetItemSubClassInfo(LE_ITEM_CLASS_ARMOR, k)
end end


for i, subclass in ipairs(unusable[2]) do for _, subclass in ipairs(unusable[2]) do
unusable[subs[subclass + 1]] = true unusable[subs[subclass + 1]] = true
end end


Expand Down Expand Up @@ -592,7 +592,7 @@ function Stuffing:BagType(bag)
end end


function Stuffing:BagNew(bag, f) function Stuffing:BagNew(bag, f)
for i, v in pairs(self.bags) do for _, v in pairs(self.bags) do
if v:GetID() == bag then if v:GetID() == bag then
v.bagType = self:BagType(bag) v.bagType = self:BagType(bag)
return v return v
Expand Down Expand Up @@ -1251,7 +1251,7 @@ function Stuffing:BAG_CLOSED(id)
end end


function Stuffing:BAG_UPDATE_COOLDOWN() function Stuffing:BAG_UPDATE_COOLDOWN()
for i, v in pairs(self.buttons) do for _, v in pairs(self.buttons) do
self:UpdateCooldowns(v) self:UpdateCooldowns(v)
end end
end end
Expand Down Expand Up @@ -1428,17 +1428,17 @@ function Stuffing:Restack()


Stuffing_Open() Stuffing_Open()


for i, v in pairs(self.buttons) do for _, v in pairs(self.buttons) do
if InBags(v.bag) then if InBags(v.bag) then
local _, cnt, _, _, _, _, clink = GetContainerItemInfo(v.bag, v.slot) local _, cnt, _, _, _, _, clink = GetContainerItemInfo(v.bag, v.slot)
if clink then if clink then
local n, _, _, _, _, _, _, s = GetItemInfo(clink) local n, _, _, _, _, _, _, s = GetItemInfo(clink)


if n and cnt ~= s then if n and cnt ~= s then
if not st[n] then if not st[clink] then
st[n] = {{item = v, size = cnt, max = s}} st[clink] = {{item = v, size = cnt, max = s}}
else else
table.insert(st[n], {item = v, size = cnt, max = s}) table.insert(st[clink], {item = v, size = cnt, max = s})
end end
end end
end end
Expand All @@ -1447,7 +1447,7 @@ function Stuffing:Restack()


local did_restack = false local did_restack = false


for i, v in pairs(st) do for _, v in pairs(st) do
if #v > 1 then if #v > 1 then
for j = 2, #v, 2 do for j = 2, #v, 2 do
local a, b = v[j - 1], v[j] local a, b = v[j - 1], v[j]
Expand Down

0 comments on commit ac8f852

Please sign in to comment.