summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Lorenz <44411062+12xx12@users.noreply.github.com>2021-12-21 13:21:58 +0100
committerAlexander Harkness <me@bearbin.net>2022-01-14 20:43:29 +0100
commitc741d81017dc9d156091e122f6bf91a84d1b32f3 (patch)
tree519ce3904f7fa72de3a0170f5009cc9f922bdb54
parentfixed possible 64+64 error (diff)
downloadcuberite-c741d81017dc9d156091e122f6bf91a84d1b32f3.tar
cuberite-c741d81017dc9d156091e122f6bf91a84d1b32f3.tar.gz
cuberite-c741d81017dc9d156091e122f6bf91a84d1b32f3.tar.bz2
cuberite-c741d81017dc9d156091e122f6bf91a84d1b32f3.tar.lz
cuberite-c741d81017dc9d156091e122f6bf91a84d1b32f3.tar.xz
cuberite-c741d81017dc9d156091e122f6bf91a84d1b32f3.tar.zst
cuberite-c741d81017dc9d156091e122f6bf91a84d1b32f3.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pickup.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index 0e3cf8ef2..4f7462a1f 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -47,6 +47,9 @@ public:
{
short CombineCount = static_cast<short>(Item.m_ItemCount);
if ((CombineCount + static_cast<short>(m_Pickup->GetItem().m_ItemCount)) > static_cast<short>(Item.GetMaxStackSize()))
+ {
+ CombineCount = Item.GetMaxStackSize() - m_Pickup->GetItem().m_ItemCount;
+ }
if (CombineCount <= 0)
{