Unlock next challenge mission is previous has been passed.

This commit is contained in:
Steve 2016-03-09 23:25:54 +00:00
parent 0bcc69ee69
commit ebfea2b5c4
1 changed files with 5 additions and 2 deletions

View File

@ -104,16 +104,19 @@ void initChallengeHome(void)
static void unlockChallenges(void) static void unlockChallenges(void)
{ {
Mission *m; Mission *m;
int i; int i, prevCompleted;
i = completedChallenges = totalChallenges = 0; i = completedChallenges = totalChallenges = 0;
prevCompleted = 1;
for (m = game.challengeMissionHead.next ; m != NULL ; m = m->next) for (m = game.challengeMissionHead.next ; m != NULL ; m = m->next)
{ {
m->available = (i <= completedChallenges || dev.debug); m->available = (prevCompleted > 0 || dev.debug);
completedChallenges += m->completedChallenges; completedChallenges += m->completedChallenges;
totalChallenges += m->totalChallenges; totalChallenges += m->totalChallenges;
prevCompleted = m->completedChallenges;
i++; i++;
} }