summaryrefslogtreecommitdiffstats
path: root/source/Chunk.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-12 22:43:20 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-12 22:43:20 +0100
commit347162a82f2cba75c4eb7739d4405ea78de4f0b5 (patch)
tree35409f6d8f6061ae3f8fa4569c0962a8bd569186 /source/Chunk.cpp
parentBundled fixes [SEE DESC] (diff)
downloadcuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.gz
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.bz2
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.lz
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.xz
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.zst
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.zip
Diffstat (limited to 'source/Chunk.cpp')
-rw-r--r--source/Chunk.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/Chunk.cpp b/source/Chunk.cpp
index be75eae41..cfdcc783c 100644
--- a/source/Chunk.cpp
+++ b/source/Chunk.cpp
@@ -1679,9 +1679,9 @@ void cChunk::CollectPickupsByPlayer(cPlayer * a_Player)
for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr)
{
- if (!(*itr)->IsPickup())
+ if ((!(*itr)->IsPickup()) && (!(*itr)->IsProjectile()))
{
- continue; // Only pickups
+ continue; // Only pickups and projectiles
}
float DiffX = (float)((*itr)->GetPosX() - PosX );
float DiffY = (float)((*itr)->GetPosY() - PosY );
@@ -1695,7 +1695,14 @@ void cChunk::CollectPickupsByPlayer(cPlayer * a_Player)
);
*/
MarkDirty();
- (reinterpret_cast<cPickup *>(*itr))->CollectedBy( a_Player );
+ if ((*itr)->IsPickup())
+ {
+ (reinterpret_cast<cPickup *>(*itr))->CollectedBy(a_Player);
+ }
+ else
+ {
+ (reinterpret_cast<cProjectileEntity *>(*itr))->CollectedBy(a_Player);
+ }
}
else if (SqrDist < 5 * 5)
{