Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InventoryUtil ignoring the stack limit when extracting items #582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SquidDev
Copy link
Contributor

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.

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 meaninful performance impact (even on large inventories), but
is a nice optimisation to make.
ccserver pushed a commit to ccserver/ComputerCraft that referenced this pull request Sep 16, 2019
…xtract-overflow

Fix InventoryUtil ignoring the stack limit when extracting items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant