Use campaignFinished variable in battle, to prevent script crashes.

This commit is contained in:
Steve 2016-06-01 09:55:28 +01:00
parent 0cd73db62e
commit 4ef44ed636
4 changed files with 9 additions and 3 deletions

View File

@ -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");

View File

@ -305,7 +305,7 @@ static void executeNextLine(ScriptRunner *runner)
}
else if (strcmp(command, "END_CAMPAIGN") == 0)
{
endCampaign();
battle.campaignFinished = 1;
}
else
{

View File

@ -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;

View File

@ -360,6 +360,7 @@ typedef struct {
int zackariaSuspicionLevel;
int destroyTorelli;
float torelliFireStormAlpha;
int campaignFinished;
Entity *missionTarget;
Entity *jumpgate;
Entity *messageSpeaker;