Inventory: Add remaining items into the source slot directly #14021
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal of the PR
This PR tries to fix remaining items hanging to the pointer when splitting a stack evenly (click/tap + drag) in some cases.
How does the PR work?
This PR adds the remaining items into the source slot directly.
Currently, it only adds the result of division. This works when the original/source slot is not selected because the remaining items will be left there, but does not work when the original slot is selected (not empty).
Does it resolve any reported issue?
Yes, reported in PR 13872 by SmallJoker.
Does this relate to a goal in the roadmap?
Yes, this PR fixes a UI/UX issue.
To do
This PR is Ready for Review.
How to test
n
items.k
slots.The table below lists some
n
andk
values that this PR fixes. The formula isn
is odd andk
is 2 orn
is odd andk
isceil(n / 2)
.n
k