summaryrefslogtreecommitdiffstats
path: root/src/Entities/ProjectileEntity.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 11:39:25 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 11:39:25 +0200
commit88c877f79c37e7485f0c4cfa1ab103ed73e4f551 (patch)
treedfaa3c6349c91fc70d8b351496a9c0b3d8d12784 /src/Entities/ProjectileEntity.cpp
parentAdded destroy-timer system to splash potion entities (diff)
parentAdded m_TicksAlive to entities, allows projectiles to hit their creators (diff)
downloadcuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.gz
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.bz2
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.lz
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.xz
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.zst
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.zip
Diffstat (limited to 'src/Entities/ProjectileEntity.cpp')
-rw-r--r--src/Entities/ProjectileEntity.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp
index a55c9b895..b5e81bc0c 100644
--- a/src/Entities/ProjectileEntity.cpp
+++ b/src/Entities/ProjectileEntity.cpp
@@ -146,9 +146,11 @@ public:
(a_Entity->GetUniqueID() == m_Projectile->GetCreatorUniqueID()) // Do not check whoever shot the projectile
)
{
- // TODO: Don't check creator only for the first 5 ticks
- // so that arrows stuck in ground and dug up can hurt the player
- return false;
+ // Don't check creator only for the first 5 ticks so that projectiles can collide with the creator
+ if (m_Projectile->GetTicksAlive() <= 5)
+ {
+ return false;
+ }
}
cBoundingBox EntBox(a_Entity->GetPosition(), a_Entity->GetWidth() / 2, a_Entity->GetHeight());