summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pickup.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/Entities/Pickup.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/Entities/Pickup.cpp')
-rw-r--r--src/Entities/Pickup.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index bbc3313da..f37bb6b98 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -45,7 +45,7 @@ public:
cItem & Item = OtherPickup.GetItem();
if ((Distance < 1.2) && Item.IsEqual(m_Pickup->GetItem()) && OtherPickup.CanCombine())
{
- short CombineCount = Item.m_ItemCount;
+ char CombineCount = Item.m_ItemCount;
if ((CombineCount + m_Pickup->GetItem().m_ItemCount) > Item.GetMaxStackSize())
{
CombineCount = Item.GetMaxStackSize() - m_Pickup->GetItem().m_ItemCount;
@@ -56,7 +56,7 @@ public:
return false;
}
- m_Pickup->GetItem().AddCount(static_cast<char>(CombineCount));
+ m_Pickup->GetItem().AddCount(CombineCount);
Item.m_ItemCount -= CombineCount;
if (Item.m_ItemCount <= 0)
@@ -265,11 +265,9 @@ bool cPickup::CollectedBy(cEntity & a_Dest)
// Pickup cannot be collected because the entity has not enough space
return false;
}
-
}
else if (a_Dest.IsPlayer())
{
-
auto & Player = static_cast<cPlayer &>(a_Dest);
// If the player is a spectator, he cannot collect anything
@@ -284,7 +282,7 @@ bool cPickup::CollectedBy(cEntity & a_Dest)
return false;
}
- int NumAdded = Player.GetInventory().AddItem(m_Item);
+ char NumAdded = Player.GetInventory().AddItem(m_Item);
if (NumAdded > 0)
{
// Check achievements