mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Inventory: Fix wrong stack size behaviour and item loss (#6039)
Also fix itemFits and remove constness-nonsense
This commit is contained in:
parent
cad10ce3b7
commit
c08cc0533f
4 changed files with 8 additions and 13 deletions
|
@ -143,13 +143,12 @@ struct ItemStack
|
|||
// If cannot be added at all, returns the item back.
|
||||
// If can be added partly, decremented item is returned back.
|
||||
// If can be added fully, empty item is returned.
|
||||
ItemStack addItem(const ItemStack &newitem,
|
||||
IItemDefManager *itemdef);
|
||||
ItemStack addItem(ItemStack newitem, IItemDefManager *itemdef);
|
||||
|
||||
// Checks whether newitem could be added.
|
||||
// If restitem is non-NULL, it receives the part of newitem that
|
||||
// would be left over after adding.
|
||||
bool itemFits(const ItemStack &newitem,
|
||||
bool itemFits(ItemStack newitem,
|
||||
ItemStack *restitem, // may be NULL
|
||||
IItemDefManager *itemdef) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue