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,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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue