Allow challenges to be ended via the script.

This commit is contained in:
Steve 2016-03-07 12:30:20 +00:00
parent 885d566e6b
commit 16591691b5
3 changed files with 6 additions and 0 deletions

View File

@ -165,6 +165,10 @@ static void executeNextLine(ScriptRunner *runner)
addHudMessage(colors.red, _("Mission Failed!")); addHudMessage(colors.red, _("Mission Failed!"));
failMission(); failMission();
} }
else if (strcmp(command, "END_CHALLENGE") == 0)
{
game.currentMission->challengeData.scriptedEnd = 1;
}
else if (strcmp(command, "RETREAT_ALLIES") == 0) else if (strcmp(command, "RETREAT_ALLIES") == 0)
{ {
battle.isEpic = 0; battle.isEpic = 0;

View File

@ -37,3 +37,4 @@ extern char *getTranslatedString(char *string);
extern Battle battle; extern Battle battle;
extern Colors colors; extern Colors colors;
extern Game game;

View File

@ -254,6 +254,7 @@ typedef struct {
int noBoost; int noBoost;
int noECM; int noECM;
int noGuns; int noGuns;
int scriptedEnd;
Challenge *challenges[MAX_CHALLENGES]; Challenge *challenges[MAX_CHALLENGES];
} ChallengeData; } ChallengeData;