fix stack split (right click) with item data

This commit is contained in:
MihailRis 2025-02-18 01:04:09 +03:00
parent 3aa7d6ac28
commit 6ef82982bd

View File

@ -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;
}