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 Item Requisition occasionally deleting items #317

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

Conversation

JoshieGemFinder
Copy link

canItemStacksStack() will return false if the first stack is empty. This means if you try to insert an unstackable item into a non-smart requisition connected to a full container, it'll:

  1. Shrink that first stack to being empty.
  2. Fail to insert the split stack into the container.
  3. Try to merge the first stack and the split stack.
  4. Get false from canItemStacksStack() because the first stack is empty
  5. Return the empty stack because of the return first, deleting the item you're trying to insert

`canItemStacksStack()` will return false if the first stack is empty. This means if you try to insert an unstackable item into a non-smart requisition connected to a full container, it'll:  
1. Shrink that first stack to being empty.  
2. Fail to insert the split stack into the container.  
3. Try to merge the first stack and the split stack.
4. Get `false` from `canItemStacksStack()` because the first stack is empty  
5. Return the empty stack because of the `return first`, deleting the item you're trying to insert
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