Don't attempt to stack if the item cannot be stacked.
This commit is contained in:
parent
ab4ea38a13
commit
d30d5baafe
1 changed files with 3 additions and 3 deletions
|
@ -16,10 +16,10 @@ function core:StackGems(_,message)
|
||||||
local sourceContainer,sourceSlot,destContainer,destSlot = -1,-1,-1,-1;
|
local sourceContainer,sourceSlot,destContainer,destSlot = -1,-1,-1,-1;
|
||||||
for bag = 0,4 do
|
for bag = 0,4 do
|
||||||
for slot = 1,GetContainerNumSlots(bag) do
|
for slot = 1,GetContainerNumSlots(bag) do
|
||||||
itemId = GetContainerItemID(bag,slot)
|
local itemId = GetContainerItemID(bag,slot)
|
||||||
if(itemId) then
|
if(itemId) then
|
||||||
itemName = GetItemInfo(itemId);
|
local itemName,_,_,_,_,_,_,maxStack = GetItemInfo(itemId);
|
||||||
if(gem == itemName) then
|
if(gem == itemName and maxStack ~= 1) then
|
||||||
local _,count = GetContainerItemInfo(bag,slot);
|
local _,count = GetContainerItemInfo(bag,slot);
|
||||||
if(count == 1 and sourceContainer < 0) then
|
if(count == 1 and sourceContainer < 0) then
|
||||||
sourceContainer = bag;
|
sourceContainer = bag;
|
||||||
|
|
Loading…
Reference in a new issue