mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix stack split (right click) with item data
This commit is contained in:
parent
3aa7d6ac28
commit
6ef82982bd
1 changed files with 3 additions and 2 deletions
|
|
@ -300,10 +300,11 @@ void SlotView::performRightClick(ItemStack& stack, ItemStack& grabbed) {
|
|||
return;
|
||||
if (grabbed.isEmpty()) {
|
||||
if (!stack.isEmpty() && layout.taking) {
|
||||
grabbed.set(stack);
|
||||
grabbed.set(std::move(stack));
|
||||
int halfremain = stack.getCount() / 2;
|
||||
grabbed.setCount(stack.getCount() - halfremain);
|
||||
stack.setCount(halfremain);
|
||||
// reset all data in the origin slot
|
||||
stack = ItemStack(stack.getItemId(), halfremain);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue