1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Client: fix unknown texture upon shift-move to full inventory list (#14586)

Fixes a regression caused by 4245a760
'moveItemSomewhere' attempted to add a leftover stack to an empty stack, resulting
in an empty name with non-0 ItemStack count.
This commit is contained in:
SmallJoker 2024-04-28 19:45:09 +02:00 committed by GitHub
parent 72cb4e9bea
commit c044a3c1ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 2 deletions

View file

@ -758,8 +758,9 @@ void InventoryList::moveItemSomewhere(u32 i, InventoryList *dest, u32 count)
if (!leftover.empty()) {
// Add the remaining part back to the source item
ItemStack &source = getItem(i);
source.add(leftover.count); // do NOT use addItem to allow oversized stacks!
// do NOT use addItem to allow oversized stacks!
leftover.add(getItem(i).count);
changeItem(i, leftover);
}
}