Craft marked as EF_AI_TARGET will be attacked even if they are dodging and avoiding combat.

This commit is contained in:
Steve 2016-03-07 12:31:22 +00:00
parent 16591691b5
commit 6ef07a65e2
2 changed files with 7 additions and 3 deletions

View File

@ -319,11 +319,14 @@ static int canAttack(Entity *e)
{ {
self->selectedGunType = self->guns[0].type; self->selectedGunType = self->guns[0].type;
if (e->aiFlags & (AIF_AVOIDS_COMBAT | AIF_EVADE) || e->flags & EF_SECONDARY_TARGET) if (!(e->flags & EF_AI_TARGET))
{ {
if (rand() % 10) if (e->aiFlags & (AIF_AVOIDS_COMBAT | AIF_EVADE) || e->flags & EF_SECONDARY_TARGET)
{ {
return 0; if (rand() % 5)
{
return 0;
}
} }
} }

View File

@ -44,3 +44,4 @@ extern Colors colors;
extern Dev dev; extern Dev dev;
extern Entity *self; extern Entity *self;
extern Entity *player; extern Entity *player;
extern Game game;