summaryrefslogtreecommitdiffstats
path: root/src/Inventory.cpp
diff options
context:
space:
mode:
authorx12xx12x <44411062+12xx12@users.noreply.github.com>2021-11-26 00:51:47 +0100
committerAlexander Harkness <me@bearbin.net>2022-01-14 20:43:29 +0100
commit250b8eb652a57dcbdff4af7b6efb9c2554b45798 (patch)
tree1d8bf1aaeac6974d75c83524c8000161d8cc104c /src/Inventory.cpp
parentFix WriteXZYPosition64 and add tests (diff)
downloadcuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.gz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.bz2
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.lz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.xz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.zst
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.zip
Diffstat (limited to 'src/Inventory.cpp')
-rw-r--r--src/Inventory.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Inventory.cpp b/src/Inventory.cpp
index 2fdd1c25f..914122cee 100644
--- a/src/Inventory.cpp
+++ b/src/Inventory.cpp
@@ -78,7 +78,7 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int
}
char NumLeft = a_ItemStack.m_ItemCount;
- int MaxStack = a_ItemStack.GetMaxStackSize();
+ char MaxStack = a_ItemStack.GetMaxStackSize();
for (int i = a_BeginSlotNum; i <= a_EndSlotNum; i++)
{
const cItem & Slot = GetSlot(i);
@@ -103,12 +103,12 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int
-int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
+char cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
{
m_Owner.AddKnownItem(a_Item);
cItem ToAdd(a_Item);
- int res = 0;
+ char res = 0;
// When the item is a armor, try to set it directly to the armor slot.
if (ItemCategory::IsArmor(a_Item.m_ItemType))
@@ -162,12 +162,12 @@ int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
-int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks)
+char cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks)
{
- int TotalAdded = 0;
+ char TotalAdded = 0;
for (cItems::iterator itr = a_ItemStackList.begin(); itr != a_ItemStackList.end();)
{
- int NumAdded = AddItem(*itr, a_AllowNewStacks);
+ char NumAdded = AddItem(*itr, a_AllowNewStacks);
if (itr->m_ItemCount == NumAdded)
{
itr = a_ItemStackList.erase(itr);
@@ -188,7 +188,7 @@ int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks)
int cInventory::RemoveItem(const cItem & a_ItemStack)
{
- int RemovedItems = m_ShieldSlots.RemoveItem(a_ItemStack);
+ char RemovedItems = m_ShieldSlots.RemoveItem(a_ItemStack);
if (RemovedItems < a_ItemStack.m_ItemCount)
{
@@ -495,7 +495,7 @@ bool cInventory::DamageEquippedItem(short a_Amount)
-int cInventory::ChangeSlotCount(int a_SlotNum, int a_AddToCount)
+char cInventory::ChangeSlotCount(int a_SlotNum, char a_AddToCount)
{
int GridSlotNum = 0;
cItemGrid * Grid = GetGridForSlotNum(a_SlotNum, GridSlotNum);