fix: InventoryView: when moving one object with the right mouse button, the phantom remained

This commit is contained in:
alexei-zebra 2025-12-20 02:04:49 +03:00
parent c6c23c3c53
commit c7da5fa569

View file

@ -126,9 +126,7 @@ static std::wstring get_caption_string(
langs::get(util::str2wstr_utf8(caption->asString()))
);
} else {
return util::pascal_case(
langs::get(util::str2wstr_utf8(item.caption))
);
return util::pascal_case(langs::get(util::str2wstr_utf8(item.caption)));
}
}
// TODO: Refactor
@ -395,7 +393,11 @@ void SlotView::performRightClick(ItemStack& stack, ItemStack& grabbed) {
int halfremain = stack.getCount() / 2;
grabbed.setCount(stack.getCount() - halfremain);
// reset all data in the origin slot
stack = ItemStack(stack.getItemId(), halfremain);
if (stack.getCount() > 1) {
stack = ItemStack(stack.getItemId(), halfremain);
} else {
stack = ItemStack(0, 0);
}
}
return;
}