Merge pull request #744 from alexei-zebra/fix-inventory-phantom-item

fix InventoryView: phantom item
This commit is contained in:
MihailRis 2025-12-20 22:40:07 +03:00 • committed by GitHub
commit 28dbdae6fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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