summaryrefslogtreecommitdiffstats
path: root/source/Inventory.h
diff options
context:
space:
mode:
authormadmaxoft <madmaxoft@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-03 15:56:11 +0200
committermadmaxoft <madmaxoft@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-03 15:56:11 +0200
commite27a5db409fe1d71c42235609a9fe06020b6201b (patch)
tree28376a912b0f01f89c048f7eb25becf10ceb287c /source/Inventory.h
parentUpdated LimitWorld. (Patch by tonibm19) (diff)
downloadcuberite-e27a5db409fe1d71c42235609a9fe06020b6201b.tar
cuberite-e27a5db409fe1d71c42235609a9fe06020b6201b.tar.gz
cuberite-e27a5db409fe1d71c42235609a9fe06020b6201b.tar.bz2
cuberite-e27a5db409fe1d71c42235609a9fe06020b6201b.tar.lz
cuberite-e27a5db409fe1d71c42235609a9fe06020b6201b.tar.xz
cuberite-e27a5db409fe1d71c42235609a9fe06020b6201b.tar.zst
cuberite-e27a5db409fe1d71c42235609a9fe06020b6201b.zip
Diffstat (limited to 'source/Inventory.h')
-rw-r--r--source/Inventory.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/Inventory.h b/source/Inventory.h
index 395ca8982..9ddd00ecd 100644
--- a/source/Inventory.h
+++ b/source/Inventory.h
@@ -66,17 +66,23 @@ public:
/** Adds as many items out of a_ItemStack as can fit.
If a_AllowNewStacks is set to false, only existing stacks can be topped up;
if a_AllowNewStacks is set to true, empty slots can be used for the rest.
+ If a_tryToFillEquippedFirst is set to true, the currently equipped slot will be used first (if empty or
+ compatible with added items)
+ if a_tryToFillEquippedFirst is set to false, the regular order applies.
Returns the number of items that fit.
*/
- int AddItem(const cItem & a_ItemStack, bool a_AllowNewStacks = true);
+ int AddItem(const cItem & a_ItemStack, bool a_AllowNewStacks = true, bool a_tryToFillEquippedFirst = false);
/** Same as AddItem, but works on an entire list of item stacks.
The a_ItemStackList is modified to reflect the leftover items.
If a_AllowNewStacks is set to false, only existing stacks can be topped up;
- if a_AllowNewStacks is set to true, empty slots can be used for the rest
+ if a_AllowNewStacks is set to true, empty slots can be used for the rest.
+ If a_tryToFillEquippedFirst is set to true, the currently equipped slot will be used first (if empty or
+ compatible with added items)
+ if a_tryToFillEquippedFirst is set to false, the regular order applies.
Returns the total number of items that fit.
*/
- int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks);
+ int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst);
/// Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed
bool RemoveOneEquippedItem(void);