summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pickup.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-07 18:07:14 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-19 06:05:22 +0100
commit83459d0d899786378e8304c92a5b79ddca92c62f (patch)
tree637e5302c5c5affc5f3c52d4c195cba5607aac30 /src/Entities/Pickup.cpp
parentMerge pull request #3020 from cuberite/ice_block (diff)
downloadcuberite-83459d0d899786378e8304c92a5b79ddca92c62f.tar
cuberite-83459d0d899786378e8304c92a5b79ddca92c62f.tar.gz
cuberite-83459d0d899786378e8304c92a5b79ddca92c62f.tar.bz2
cuberite-83459d0d899786378e8304c92a5b79ddca92c62f.tar.lz
cuberite-83459d0d899786378e8304c92a5b79ddca92c62f.tar.xz
cuberite-83459d0d899786378e8304c92a5b79ddca92c62f.tar.zst
cuberite-83459d0d899786378e8304c92a5b79ddca92c62f.zip
Diffstat (limited to 'src/Entities/Pickup.cpp')
-rw-r--r--src/Entities/Pickup.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index c2bcf3960..bdb9128dc 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -30,11 +30,13 @@ public:
virtual bool Item(cEntity * a_Entity) override
{
- if (!a_Entity->IsPickup() || (a_Entity->GetUniqueID() <= m_Pickup->GetUniqueID()) || a_Entity->IsDestroyed())
+ ASSERT(a_Entity->IsTicking());
+ if (!a_Entity->IsPickup() || (a_Entity->GetUniqueID() <= m_Pickup->GetUniqueID()))
{
return false;
}
+
Vector3d EntityPos = a_Entity->GetPosition();
double Distance = (EntityPos - m_Position).Length();
@@ -152,7 +154,7 @@ void cPickup::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
}
// Try to combine the pickup with adjacent same-item pickups:
- if (!IsDestroyed() && (m_Item.m_ItemCount < m_Item.GetMaxStackSize())) // Don't combine if already full
+ if ((m_Item.m_ItemCount < m_Item.GetMaxStackSize())) // Don't combine if already full
{
// By using a_Chunk's ForEachEntity() instead of cWorld's, pickups don't combine across chunk boundaries.
// That is a small price to pay for not having to traverse the entire world for each entity.