summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2017-06-25 11:39:39 +0200
committerGitHub <noreply@github.com>2017-06-25 11:39:39 +0200
commitc08cc0533fbf344be5243485f39a471268855149 (patch)
treef9b5c51903572e2eafa7b4781a06768b1ed554db /src/inventory.h
parentcad10ce3b747b721fd63784915e05f12bc488128 (diff)
downloadminetest-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.h5
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;