summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-06-24 17:50:38 +0200
committerHowaner <franzi.moos@googlemail.com>2014-06-24 17:50:38 +0200
commitdbcb7f819fc900164d644a1932d0cdc78b707ae0 (patch)
tree538edc5066a23a02bf724b9088df37c33882da0f
parentBetter combining. (diff)
downloadcuberite-dbcb7f819fc900164d644a1932d0cdc78b707ae0.tar
cuberite-dbcb7f819fc900164d644a1932d0cdc78b707ae0.tar.gz
cuberite-dbcb7f819fc900164d644a1932d0cdc78b707ae0.tar.bz2
cuberite-dbcb7f819fc900164d644a1932d0cdc78b707ae0.tar.lz
cuberite-dbcb7f819fc900164d644a1932d0cdc78b707ae0.tar.xz
cuberite-dbcb7f819fc900164d644a1932d0cdc78b707ae0.tar.zst
cuberite-dbcb7f819fc900164d644a1932d0cdc78b707ae0.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pickup.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index 6cab79b91..44a65412f 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -30,7 +30,7 @@ public:
virtual bool Item(cEntity * a_Entity) override
{
- if (!a_Entity->IsPickup() || (a_Entity->GetUniqueID() == m_Pickup->GetUniqueID()) || a_Entity->IsDestroyed())
+ if (!a_Entity->IsPickup() || (a_Entity->GetUniqueID() <= m_Pickup->GetUniqueID()) || a_Entity->IsDestroyed())
{
return false;
}
@@ -150,7 +150,7 @@ void cPickup::Tick(float a_Dt, cChunk & a_Chunk)
}
}
- if (!IsDestroyed()) // Don't try to combine if someone has tried to combine me
+ if (!IsDestroyed() && (m_Item.m_ItemCount < m_Item.GetMaxStackSize())) // Don't try to combine if someone has tried to combine me
{
cPickupCombiningCallback PickupCombiningCallback(GetPosition(), this);
m_World->ForEachEntity(PickupCombiningCallback); // Not ForEachEntityInChunk, otherwise pickups don't combine across chunk boundaries
@@ -227,7 +227,7 @@ bool cPickup::CollectedBy(cPlayer * a_Dest)
m_World->BroadcastCollectPickup(*this, *a_Dest);
// Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;)
m_World->BroadcastSoundEffect("random.pop",(int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64));
- if (m_Item.m_ItemCount == 0)
+ if (m_Item.m_ItemCount <= 0)
{
// All of the pickup has been collected, schedule the pickup for destroying
m_bCollected = true;