Don't let AI fire missiles at point-blank range.

This commit is contained in:
Steve 2015-11-28 15:30:07 +00:00
parent 3fb9e8ef97
commit 886084f60f
1 changed files with 3 additions and 1 deletions

View File

@ -352,9 +352,11 @@ static void preAttack(void)
{
fireGuns(self);
}
else if (self->missiles)
else if (self->missiles && getDistance(self->x, self->y, self->target->x, self->target->y) >= 350)
{
fireMissile(self);
self->action = doAI;
}
}
else