Don't require optional missions to need the previous mission to be completed.
This commit is contained in:
parent
345a45f9c4
commit
142c02c1ed
|
@ -81,7 +81,8 @@ Mission *loadMissionMeta(char *filename)
|
||||||
}
|
}
|
||||||
else
|
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);
|
free(text);
|
||||||
|
@ -466,14 +467,20 @@ void updateAllMissions(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int isMissionAvailable(Mission *mission, Mission *prev)
|
int isMissionAvailable(Mission *mission, Mission *prev)
|
||||||
|
{
|
||||||
|
if (!mission->isOptional)
|
||||||
|
{
|
||||||
|
return (prev->completed && game.completedMissions >= mission->requires) || dev.debug;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
prev->completed &&
|
game.completedMissions >= mission->requires &&
|
||||||
mission->requires <= game.completedMissions &&
|
|
||||||
game.stats[STAT_OPTIONAL_COMPLETED] >= mission->requiresOptional &&
|
game.stats[STAT_OPTIONAL_COMPLETED] >= mission->requiresOptional &&
|
||||||
(!mission->expires || (game.completedMissions < mission->expires))
|
game.completedMissions < mission->expires
|
||||||
) || dev.debug;
|
) || dev.debug;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned long hashcode(const char *str)
|
static unsigned long hashcode(const char *str)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue