Bullets don't hit their own entity groups (mainly for capital ships).

This commit is contained in:
Steve 2015-12-10 10:16:16 +00:00
parent 1b1a4ca792
commit 833043ba7d
1 changed files with 5 additions and 0 deletions

View File

@ -136,6 +136,11 @@ static void checkCollisions(Bullet *b)
{ {
if (e->flags & EF_TAKES_DAMAGE) if (e->flags & EF_TAKES_DAMAGE)
{ {
if (b->owner->owner != NULL && b->owner->owner == e->owner)
{
continue;
}
if (b->owner != e && e->health > 0 && collision(b->x - b->w / 2, b->y - b->h / 2, b->w, b->h, e->x - e->w / 2, e->y - e->h / 2, e->w, e->h)) if (b->owner != e && e->health > 0 && collision(b->x - b->w / 2, b->y - b->h / 2, b->w, b->h, e->x - e->w / 2, e->y - e->h / 2, e->w, e->h))
{ {
if (b->owner->side == e->side) if (b->owner->side == e->side)