fix stack increment (right click) with item data
This commit is contained in:
parent
6ef82982bd
commit
449b0ebca4
@ -313,9 +313,14 @@ void SlotView::performRightClick(ItemStack& stack, ItemStack& grabbed) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (stack.isEmpty()) {
|
if (stack.isEmpty()) {
|
||||||
stack.set(grabbed);
|
itemcount_t count = grabbed.getCount();
|
||||||
|
stack.set(std::move(grabbed));
|
||||||
stack.setCount(1);
|
stack.setCount(1);
|
||||||
grabbed.setCount(grabbed.getCount() - 1);
|
if (count == 1) {
|
||||||
|
grabbed = {};
|
||||||
|
} else {
|
||||||
|
grabbed = ItemStack(stack.getItemId(), count - 1);
|
||||||
|
}
|
||||||
} else if (stack.accepts(grabbed) && stack.getCount() < stackDef.stackSize) {
|
} else if (stack.accepts(grabbed) && stack.getCount() < stackDef.stackSize) {
|
||||||
stack.setCount(stack.getCount() + 1);
|
stack.setCount(stack.getCount() + 1);
|
||||||
grabbed.setCount(grabbed.getCount() - 1);
|
grabbed.setCount(grabbed.getCount() - 1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user