1
0

Added m_TicksAlive to entities, allows projectiles to hit their creators

This commit is contained in:
archshift
2014-07-20 01:43:07 -07:00
parent 9e155c6add
commit 726312602d
3 changed files with 14 additions and 3 deletions

View File

@@ -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());