diff --git a/src/battle/battle.c b/src/battle/battle.c index 4b1103c..ede58a9 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -36,6 +36,7 @@ static void options(void); static void returnFromOptions(void); static void checkSuspicionLevel(void); static void doTorelliFireStorm(void); +static void endCampaign(void); static int show; static float ssx, ssy; @@ -116,6 +117,11 @@ static void logic(void) } app.doTrophyAlerts = (battle.status != MS_IN_PROGRESS && battle.missionFinishedTimer <= -FPS * 2); + + if (battle.campaignFinished) + { + endCampaign(); + } } doWidgets(); @@ -425,7 +431,7 @@ static void doTorelliFireStorm(void) } } -void endCampaign(void) +static void endCampaign(void) { awardTrophy("CAMPAIGN_COMPLETE"); diff --git a/src/battle/script.c b/src/battle/script.c index 188d4df..b50bf16 100644 --- a/src/battle/script.c +++ b/src/battle/script.c @@ -305,7 +305,7 @@ static void executeNextLine(ScriptRunner *runner) } else if (strcmp(command, "END_CAMPAIGN") == 0) { - endCampaign(); + battle.campaignFinished = 1; } else { diff --git a/src/battle/script.h b/src/battle/script.h index 2e5a609..450ad5a 100644 --- a/src/battle/script.h +++ b/src/battle/script.h @@ -42,7 +42,6 @@ extern void createChristabelLocation(void); extern void killEntity(char *name); extern void updateEntitySide(char *side, char *entity); extern void activateTrespasserSpawner(void); -extern void endCampaign(void); extern Battle battle; extern Colors colors; diff --git a/src/structs.h b/src/structs.h index 58628ef..a80e188 100644 --- a/src/structs.h +++ b/src/structs.h @@ -360,6 +360,7 @@ typedef struct { int zackariaSuspicionLevel; int destroyTorelli; float torelliFireStormAlpha; + int campaignFinished; Entity *missionTarget; Entity *jumpgate; Entity *messageSpeaker;