Give AIF_TARGET_FOCUS fighters a low chance of targetting something else.

This commit is contained in:
Steve 2016-04-16 10:59:42 +01:00
parent 259a02699a
commit 344b2d27b8
1 changed files with 2 additions and 1 deletions

View File

@ -352,9 +352,10 @@ static int canAttack(Entity *e)
}
}
/* low chance of attacking something else */
if ((self->aiFlags & AIF_TARGET_FOCUS) && (!(e->flags & EF_AI_TARGET)))
{
return 0;
return !(rand() % 100);
}
return 1;