ComputerCraft icon indicating copy to clipboard operation
ComputerCraft copied to clipboard

Fix InventoryUtil ignoring the stack limit when extracting items

Open SquidDev opened this issue 5 years ago • 0 comments

Using turtle.suck on an inventory filled with tools would fill the entire chest with said item, rather than extracting a single item. In order to avoid that, we clamp the extract limit to the max stack size when first extracting an item.

This also inlines the makeSlotList logic, which means we can avoid creating an array for each inventory operation. This probably won't have any meaningful performance impact (even on large inventories), but is a nice optimisation to make.

SquidDev avatar Nov 27 '18 17:11 SquidDev