Craft marked as EF_AI_TARGET will be attacked even if they are dodging and avoiding combat.
This commit is contained in:
parent
16591691b5
commit
6ef07a65e2
|
@ -319,13 +319,16 @@ static int canAttack(Entity *e)
|
|||
{
|
||||
self->selectedGunType = self->guns[0].type;
|
||||
|
||||
if (!(e->flags & EF_AI_TARGET))
|
||||
{
|
||||
if (e->aiFlags & (AIF_AVOIDS_COMBAT | AIF_EVADE) || e->flags & EF_SECONDARY_TARGET)
|
||||
{
|
||||
if (rand() % 10)
|
||||
if (rand() % 5)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (e->flags & EF_MUST_DISABLE)
|
||||
{
|
||||
|
|
|
@ -44,3 +44,4 @@ extern Colors colors;
|
|||
extern Dev dev;
|
||||
extern Entity *self;
|
||||
extern Entity *player;
|
||||
extern Game game;
|
||||
|
|
Loading…
Reference in New Issue