From 142c02c1eddcc64f5d3d2d7a0dfcca8fa9fa1a3b Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 7 Jun 2016 08:31:02 +0100 Subject: [PATCH] Don't require optional missions to need the previous mission to be completed. --- src/galaxy/mission.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index ffa0080..3662fee 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -81,7 +81,8 @@ Mission *loadMissionMeta(char *filename) } else { - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to load '%s'", filename); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "Failed to load '%s'", filename); + exit(1); } free(text); @@ -467,12 +468,18 @@ void updateAllMissions(void) int isMissionAvailable(Mission *mission, Mission *prev) { - return ( - prev->completed && - mission->requires <= game.completedMissions && - game.stats[STAT_OPTIONAL_COMPLETED] >= mission->requiresOptional && - (!mission->expires || (game.completedMissions < mission->expires)) - ) || dev.debug; + if (!mission->isOptional) + { + return (prev->completed && game.completedMissions >= mission->requires) || dev.debug; + } + else + { + return ( + game.completedMissions >= mission->requires && + game.stats[STAT_OPTIONAL_COMPLETED] >= mission->requiresOptional && + game.completedMissions < mission->expires + ) || dev.debug; + } } static unsigned long hashcode(const char *str)