diff options
author | Persson-dev <66266021+Persson-dev@users.noreply.github.com> | 2021-12-29 20:28:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 20:28:41 +0100 |
commit | fec64bb91c03c5e872a8f6fbc1a253f341373072 (patch) | |
tree | 74eca1320f61b93cae672a0d9def7abea2ab80ef /src/ChunkMap.cpp | |
parent | Update solid and transparent blocks (#5353) (diff) | |
download | cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.gz cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.bz2 cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.lz cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.xz cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.zst cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 12 |
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 |