summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r--src/ChunkMap.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index 9e39338de..c3139ed9c 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -439,14 +439,14 @@ void cChunkMap::FastSetBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLET
-void cChunkMap::CollectPickupsByPlayer(cPlayer & a_Player)
+void cChunkMap::CollectPickupsByEntity(cEntity & a_Entity)
{
cCSLock Lock(m_CSChunks);
- auto BoundingBox = a_Player.GetBoundingBox();
+ auto BoundingBox = a_Entity.GetBoundingBox();
BoundingBox.Expand(1, 0.5, 1);
- ForEachEntityInBox(BoundingBox, [&a_Player](cEntity & Entity)
+ ForEachEntityInBox(BoundingBox, [&a_Entity](cEntity & Entity)
{
// Only pickups and projectiles can be picked up:
if (Entity.IsPickup())
@@ -456,11 +456,11 @@ void cChunkMap::CollectPickupsByPlayer(cPlayer & a_Player)
(*itr)->GetUniqueID(), a_Player->GetName().c_str(), SqrDist
);
*/
- static_cast<cPickup &>(Entity).CollectedBy(a_Player);
+ static_cast<cPickup &>(Entity).CollectedBy(a_Entity);
}
- else if (Entity.IsProjectile())
+ else if (Entity.IsProjectile() && a_Entity.IsPlayer())
{
- static_cast<cProjectileEntity &>(Entity).CollectedBy(a_Player);
+ static_cast<cProjectileEntity &>(Entity).CollectedBy(static_cast<cPlayer&>(a_Entity));
}
// The entities will MarkDirty when they Destroy themselves