diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2017-06-25 11:39:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-25 11:39:39 +0200 |
commit | c08cc0533fbf344be5243485f39a471268855149 (patch) | |
tree | f9b5c51903572e2eafa7b4781a06768b1ed554db /src/inventory.h | |
parent | cad10ce3b747b721fd63784915e05f12bc488128 (diff) | |
download | minetest-c08cc0533fbf344be5243485f39a471268855149.tar.gz minetest-c08cc0533fbf344be5243485f39a471268855149.tar.bz2 minetest-c08cc0533fbf344be5243485f39a471268855149.zip |
Inventory: Fix wrong stack size behaviour and item loss (#6039)
Also fix itemFits and remove constness-nonsense
Diffstat (limited to 'src/inventory.h')
-rw-r--r-- | src/inventory.h | 5 |
1 files changed, 2 insertions, 3 deletions
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; |