diff --git a/src/galaxy/galacticMap.c b/src/galaxy/galacticMap.c index bb25ae5..696def0 100644 --- a/src/galaxy/galacticMap.c +++ b/src/galaxy/galacticMap.c @@ -301,7 +301,16 @@ static void addPulses(void) switch (starSystem->type) { case SS_NORMAL: - pulse->r = 255; + if (!starSystem->activeMission->isOptional) + { + pulse->r = 255; + } + else + { + pulse->r = 128; + pulse->g = 128; + pulse->b = 255; + } break; case SS_SOL: @@ -563,7 +572,7 @@ static void drawStarSystemDetail(void) * this only really counts for Alba, as it has 10 missions and there's only space for 9 to display. * We need to subtract 1 from the completed missions to get the correct number (mission at the bottom will be the one to select). */ - start = MIN(selectedStarSystem->completedMissions - 1 - MAX_LISTED_MISSIONS, 0); + start = MAX(selectedStarSystem->availableMissions - MAX_LISTED_MISSIONS, 0); i = 0; @@ -592,6 +601,8 @@ static void drawStarSystemDetail(void) y += 50; } + + i++; } if (game.currentMission->available) diff --git a/src/galaxy/starSystems.c b/src/galaxy/starSystems.c index 29db419..cddc3d5 100644 --- a/src/galaxy/starSystems.c +++ b/src/galaxy/starSystems.c @@ -133,12 +133,13 @@ void updateStarSystemMissions(void) { StarSystem *starSystem; Mission *mission, *prev; + int numOptional, completedOptional; game.completedMissions = game.totalMissions = game.availableMissions = 0; for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next) { - starSystem->completedMissions = starSystem->availableMissions = starSystem->totalMissions = 0; + numOptional = completedOptional = starSystem->completedMissions = starSystem->availableMissions = starSystem->totalMissions = 0; for (mission = starSystem->missionHead.next ; mission != NULL ; mission = mission->next) { @@ -148,12 +149,22 @@ void updateStarSystemMissions(void) { starSystem->completedMissions++; } + + if (mission->isOptional && starSystem->type == SS_NORMAL) + { + numOptional++; + + if (mission->completed) + { + completedOptional++; + } + } } if (starSystem->type == SS_NORMAL) { - game.totalMissions += starSystem->totalMissions; - game.completedMissions += starSystem->completedMissions; + game.totalMissions += (starSystem->totalMissions - numOptional); + game.completedMissions += (starSystem->completedMissions - completedOptional); } } @@ -168,6 +179,8 @@ void updateStarSystemMissions(void) if (mission->available) { starSystem->availableMissions++; + + starSystem->activeMission = mission; } prev = mission; diff --git a/src/structs.h b/src/structs.h index a22b4b6..ab44107 100644 --- a/src/structs.h +++ b/src/structs.h @@ -304,6 +304,7 @@ struct StarSystem { int availableMissions; int fallsToPandorans; int type; + Mission *activeMission; Mission missionHead; StarSystem *next; };