Projectiles don't collide with their creators.

master
madmaxoft 2013-09-02 21:40:56 +02:00
parent f5e0c8c77e
commit 7433b3723c
1 changed files with 6 additions and 2 deletions

View File

@ -85,9 +85,13 @@ public:
virtual bool Item(cEntity * a_Entity) override
{
if (a_Entity == m_Projectile)
if (
(a_Entity == m_Projectile) || // Do not check collisions with self
(a_Entity == m_Projectile->GetCreator()) // Do not check whoever shot the projectile
)
{
// Self-colision
// 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;
}