Auto select first challenge when coming from title.
This commit is contained in:
parent
2c71b16e17
commit
05185950e4
|
@ -74,8 +74,6 @@ void initChallengeHome(void)
|
|||
planet.x = rand() % SCREEN_WIDTH;
|
||||
planet.y = rand() % SCREEN_HEIGHT;
|
||||
|
||||
game.currentMission = NULL;
|
||||
|
||||
startIndex = 0;
|
||||
|
||||
show = SHOW_CHALLENGES;
|
||||
|
@ -93,6 +91,13 @@ void initChallengeHome(void)
|
|||
|
||||
getWidget("ok", "stats")->action = statsOK;
|
||||
|
||||
/* select first challenge if none chosen */
|
||||
if (!game.currentMission)
|
||||
{
|
||||
game.currentMission = game.challengeMissionHead.next;
|
||||
updateChallengeMissionData();
|
||||
}
|
||||
|
||||
endSectionTransition();
|
||||
|
||||
playMusic("music/covert_operations.mp3");
|
||||
|
@ -107,9 +112,7 @@ static void unlockChallenges(void)
|
|||
|
||||
for (m = game.challengeMissionHead.next ; m != NULL ; m = m->next)
|
||||
{
|
||||
m->available = i <= completedChallenges;
|
||||
|
||||
m->available = 1;
|
||||
m->available = (i <= completedChallenges || dev.debug);
|
||||
|
||||
completedChallenges += m->completedChallenges;
|
||||
totalChallenges += m->totalChallenges;
|
||||
|
|
|
@ -63,4 +63,5 @@ extern char *getChallengeDescription(Challenge *c);
|
|||
extern App app;
|
||||
extern Battle battle;
|
||||
extern Colors colors;
|
||||
extern Dev dev;
|
||||
extern Game game;
|
||||
|
|
|
@ -215,6 +215,8 @@ static void campaign(void)
|
|||
|
||||
static void challenges(void)
|
||||
{
|
||||
game.currentMission = NULL;
|
||||
|
||||
initChallengeHome();
|
||||
}
|
||||
|
||||
|
|
|
@ -59,4 +59,5 @@ extern void updateAllMissions(void);
|
|||
extern App app;
|
||||
extern Battle battle;
|
||||
extern Colors colors;
|
||||
extern Game game;
|
||||
extern Entity *self;
|
||||
|
|
Loading…
Reference in New Issue