fix stack split (right click) with item data
This commit is contained in:
parent
3aa7d6ac28
commit
6ef82982bd
@ -300,10 +300,11 @@ void SlotView::performRightClick(ItemStack& stack, ItemStack& grabbed) {
|
|||||||
return;
|
return;
|
||||||
if (grabbed.isEmpty()) {
|
if (grabbed.isEmpty()) {
|
||||||
if (!stack.isEmpty() && layout.taking) {
|
if (!stack.isEmpty() && layout.taking) {
|
||||||
grabbed.set(stack);
|
grabbed.set(std::move(stack));
|
||||||
int halfremain = stack.getCount() / 2;
|
int halfremain = stack.getCount() / 2;
|
||||||
grabbed.setCount(stack.getCount() - halfremain);
|
grabbed.setCount(stack.getCount() - halfremain);
|
||||||
stack.setCount(halfremain);
|
// reset all data in the origin slot
|
||||||
|
stack = ItemStack(stack.getItemId(), halfremain);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user