From a1f65ded29778ad3b951a5c0f0e79b6c3092b9b1 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 12 Aug 2016 12:23:11 +0100 Subject: [PATCH] Count completed missions before checking if mission completion threshold reached. --- src/galaxy/starSystems.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/galaxy/starSystems.c b/src/galaxy/starSystems.c index 31ab749..3b6c822 100644 --- a/src/galaxy/starSystems.c +++ b/src/galaxy/starSystems.c @@ -147,7 +147,16 @@ void updateStarSystemMissions(void) if (starSystem->type == SS_NORMAL && !mission->isOptional) { game.totalMissions++; - game.completedMissions++; + } + + if (mission->completed) + { + starSystem->completedMissions++; + + if (starSystem->type == SS_NORMAL && !mission->isOptional) + { + game.completedMissions++; + } } } } @@ -164,19 +173,15 @@ void updateStarSystemMissions(void) { starSystem->availableMissions++; - if (mission->completed) - { - starSystem->completedMissions++; - } - else - { - starSystem->activeMission = mission; - } - if (starSystem->type == SS_NORMAL && !mission->isOptional) { game.availableMissions++; } + + if (!mission->completed) + { + starSystem->activeMission = mission; + } } prev = mission;