summaryrefslogtreecommitdiffstats
path: root/source/Inventory.cpp
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.cpp
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 '')
-rw-r--r--source/Inventory.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/Inventory.cpp b/source/Inventory.cpp
index fc52d4621..b56f50ed7 100644
--- a/source/Inventory.cpp
+++ b/source/Inventory.cpp
@@ -98,7 +98,7 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int
-int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
+int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst)
{
cItem ToAdd(a_Item);
int res = 0;
@@ -112,7 +112,7 @@ int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
}
}
- res += m_HotbarSlots.AddItem(ToAdd, a_AllowNewStacks);
+ res += m_HotbarSlots.AddItem(ToAdd, a_AllowNewStacks, a_tryToFillEquippedFirst ? m_EquippedSlotNum : -1);
ToAdd.m_ItemCount = a_Item.m_ItemCount - res;
if (ToAdd.m_ItemCount == 0)
{
@@ -127,12 +127,12 @@ int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
-int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks)
+int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst)
{
int TotalAdded = 0;
for (cItems::iterator itr = a_ItemStackList.begin(); itr != a_ItemStackList.end();)
{
- int NumAdded = AddItem(*itr, a_AllowNewStacks);
+ int NumAdded = AddItem(*itr, a_AllowNewStacks, a_tryToFillEquippedFirst);
if (itr->m_ItemCount == NumAdded)
{
itr = a_ItemStackList.erase(itr);