From c08cc0533fbf344be5243485f39a471268855149 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 25 Jun 2017 11:39:39 +0200 Subject: Inventory: Fix wrong stack size behaviour and item loss (#6039) Also fix itemFits and remove constness-nonsense --- src/inventory.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/inventory.h') diff --git a/src/inventory.h b/src/inventory.h index 04c8156c8..2f8757f1c 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -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; -- cgit v1.2.3