From 51b91befbd26b630cd2cecaec081edd03edfb5f3 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 18 Jul 2014 23:11:59 +0200 Subject: Added RemoveItem() function to the player inventory. --- src/Inventory.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Inventory.h') diff --git a/src/Inventory.h b/src/Inventory.h index e25fc4a8a..6e32536b3 100644 --- a/src/Inventory.h +++ b/src/Inventory.h @@ -86,6 +86,9 @@ public: */ int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst); + /** Remove the specified item with the specified amount from the inventory. Returns the amount from the items were was removed. */ + int RemoveItem(const cItem & a_ItemStack); + /** Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed */ bool RemoveOneEquippedItem(void); -- cgit v1.2.3 From 13311c700ffbd94f28fe38654bda4bf026d2a8ce Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 18 Jul 2014 23:47:46 +0200 Subject: Clarified RemoveItem()'s comments. --- src/Inventory.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Inventory.h') diff --git a/src/Inventory.h b/src/Inventory.h index 6e32536b3..5175afd14 100644 --- a/src/Inventory.h +++ b/src/Inventory.h @@ -86,7 +86,8 @@ public: */ int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst); - /** Remove the specified item with the specified amount from the inventory. Returns the amount from the items were was removed. */ + /** Removes the specified item from the inventory, as many as possible, up to a_ItemStack.m_ItemCount. + Returns the number of items that were removed. */ int RemoveItem(const cItem & a_ItemStack); /** Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed */ -- cgit v1.2.3