diff --git a/src/graphics/ui/elements/InventoryView.cpp b/src/graphics/ui/elements/InventoryView.cpp index 3735260c..b34736a3 100644 --- a/src/graphics/ui/elements/InventoryView.cpp +++ b/src/graphics/ui/elements/InventoryView.cpp @@ -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; }