summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pickup.cpp
diff options
context:
space:
mode:
authorMarc Lorenz <44411062+12xx12@users.noreply.github.com>2021-12-21 12:45:05 +0100
committerAlexander Harkness <me@bearbin.net>2022-01-14 20:43:29 +0100
commit00dbbabc5c9a5ad0347e9932128ee729b1e183e0 (patch)
tree887e1fb82ec64fa6620f0f5716a5341423d749db /src/Entities/Pickup.cpp
parentfixed cast (diff)
downloadcuberite-00dbbabc5c9a5ad0347e9932128ee729b1e183e0.tar
cuberite-00dbbabc5c9a5ad0347e9932128ee729b1e183e0.tar.gz
cuberite-00dbbabc5c9a5ad0347e9932128ee729b1e183e0.tar.bz2
cuberite-00dbbabc5c9a5ad0347e9932128ee729b1e183e0.tar.lz
cuberite-00dbbabc5c9a5ad0347e9932128ee729b1e183e0.tar.xz
cuberite-00dbbabc5c9a5ad0347e9932128ee729b1e183e0.tar.zst
cuberite-00dbbabc5c9a5ad0347e9932128ee729b1e183e0.zip
Diffstat (limited to 'src/Entities/Pickup.cpp')
-rw-r--r--src/Entities/Pickup.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index d266df502..0e3cf8ef2 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -45,11 +45,8 @@ public:
cItem & Item = OtherPickup.GetItem();
if ((Distance < 1.2) && Item.IsEqual(m_Pickup->GetItem()) && OtherPickup.CanCombine())
{
- char CombineCount = Item.m_ItemCount;
- if ((CombineCount + m_Pickup->GetItem().m_ItemCount) > Item.GetMaxStackSize())
- {
- CombineCount = Item.GetMaxStackSize() - m_Pickup->GetItem().m_ItemCount;
- }
+ short CombineCount = static_cast<short>(Item.m_ItemCount);
+ if ((CombineCount + static_cast<short>(m_Pickup->GetItem().m_ItemCount)) > static_cast<short>(Item.GetMaxStackSize()))
if (CombineCount <= 0)
{