From ebfea2b5c4394bfa822274ff13b8c14309c930ce Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 9 Mar 2016 23:25:54 +0000 Subject: [PATCH] Unlock next challenge mission is previous has been passed. --- src/challenges/challengeHome.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/challenges/challengeHome.c b/src/challenges/challengeHome.c index e340508..127a020 100644 --- a/src/challenges/challengeHome.c +++ b/src/challenges/challengeHome.c @@ -104,16 +104,19 @@ void initChallengeHome(void) static void unlockChallenges(void) { Mission *m; - int i; + int i, prevCompleted; i = completedChallenges = totalChallenges = 0; + prevCompleted = 1; + 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; totalChallenges += m->totalChallenges; + prevCompleted = m->completedChallenges; i++; }