Limit stack transfer
This commit is contained in:
parent
40213b6b18
commit
3a6cb08707
@ -141,7 +141,7 @@ function ItemGroup:transferTo(target, itemCount)
|
|||||||
local transferMax = math.min(itemCount or targetCap, targetCap, self:getItemCount())
|
local transferMax = math.min(itemCount or targetCap, targetCap, self:getItemCount())
|
||||||
local transfer = 0
|
local transfer = 0
|
||||||
for _,stack in targetGroup:_iterateStacks() do
|
for _,stack in targetGroup:_iterateStacks() do
|
||||||
if transfer == transferMax then
|
if transfer >= transferMax then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ function ItemGroup:transferTo(target, itemCount)
|
|||||||
if stack:getCount() == targetCount then
|
if stack:getCount() == targetCount then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
local _, xfer = from:transferTo(stack)
|
local _, xfer = from:transferTo(stack, targetCount - stack:getCount())
|
||||||
transfer = transfer + xfer
|
transfer = transfer + xfer
|
||||||
end
|
end
|
||||||
::continue::
|
::continue::
|
||||||
|
Loading…
x
Reference in New Issue
Block a user