Don't chase target very long when on Easy campaign.

This commit is contained in:
Steve 2017-05-16 08:12:32 +01:00
parent 53ab37f0e7
commit 3f19e6d1e9
1 changed files with 4 additions and 2 deletions

View File

@ -148,10 +148,12 @@ void doAI(void)
static void doFighterAI(void)
{
int r;
int r, breakOffChance;
breakOffChance = (game.currentMission->challengeData.isChallenge || game.difficulty == DIFFICULTY_NORMAL) ? 5 : 1;
/* don't hold a grudge against current target */
if ((self->target != NULL && self->target->health <= 0) || rand() % 5 == 0)
if ((self->target != NULL && self->target->health <= 0) || rand() % breakOffChance == 0)
{
self->action = doAI;
self->target = NULL;