Script call to complete the mission now also completes all objectives.

This commit is contained in:
Steve 2016-04-17 09:11:36 +01:00
parent 1fcaedda00
commit c729d59c3a
3 changed files with 12 additions and 0 deletions

View File

@ -178,6 +178,16 @@ void updateCondition(char *name, int type)
}
}
void completeAllObjectives(void)
{
Objective *o;
for (o = battle.objectiveHead.next ; o != NULL ; o = o->next)
{
o->status = OS_COMPLETE;
}
}
void completeConditions(void)
{
Objective *o;

View File

@ -245,6 +245,7 @@ static void executeNextLine(ScriptRunner *runner)
else if (strcmp(command, "COMPLETE_MISSION") == 0)
{
addHudMessage(colors.green, _("Mission Complete!"));
completeAllObjectives();
completeMission();
}
else if (strcmp(command, "FAIL_MISSION") == 0)

View File

@ -37,6 +37,7 @@ extern char *getTranslatedString(char *string);
extern void activateNextWaypoint(void);
extern void activateJumpgate(int activate);
extern void activateSpawner(char *name, int active);
extern void completeAllObjectives(void);
extern Battle battle;
extern Colors colors;