Use campaignFinished variable in battle, to prevent script crashes.
This commit is contained in:
parent
0cd73db62e
commit
4ef44ed636
|
@ -36,6 +36,7 @@ static void options(void);
|
||||||
static void returnFromOptions(void);
|
static void returnFromOptions(void);
|
||||||
static void checkSuspicionLevel(void);
|
static void checkSuspicionLevel(void);
|
||||||
static void doTorelliFireStorm(void);
|
static void doTorelliFireStorm(void);
|
||||||
|
static void endCampaign(void);
|
||||||
|
|
||||||
static int show;
|
static int show;
|
||||||
static float ssx, ssy;
|
static float ssx, ssy;
|
||||||
|
@ -116,6 +117,11 @@ static void logic(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
app.doTrophyAlerts = (battle.status != MS_IN_PROGRESS && battle.missionFinishedTimer <= -FPS * 2);
|
app.doTrophyAlerts = (battle.status != MS_IN_PROGRESS && battle.missionFinishedTimer <= -FPS * 2);
|
||||||
|
|
||||||
|
if (battle.campaignFinished)
|
||||||
|
{
|
||||||
|
endCampaign();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doWidgets();
|
doWidgets();
|
||||||
|
@ -425,7 +431,7 @@ static void doTorelliFireStorm(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void endCampaign(void)
|
static void endCampaign(void)
|
||||||
{
|
{
|
||||||
awardTrophy("CAMPAIGN_COMPLETE");
|
awardTrophy("CAMPAIGN_COMPLETE");
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,7 @@ static void executeNextLine(ScriptRunner *runner)
|
||||||
}
|
}
|
||||||
else if (strcmp(command, "END_CAMPAIGN") == 0)
|
else if (strcmp(command, "END_CAMPAIGN") == 0)
|
||||||
{
|
{
|
||||||
endCampaign();
|
battle.campaignFinished = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,7 +42,6 @@ extern void createChristabelLocation(void);
|
||||||
extern void killEntity(char *name);
|
extern void killEntity(char *name);
|
||||||
extern void updateEntitySide(char *side, char *entity);
|
extern void updateEntitySide(char *side, char *entity);
|
||||||
extern void activateTrespasserSpawner(void);
|
extern void activateTrespasserSpawner(void);
|
||||||
extern void endCampaign(void);
|
|
||||||
|
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
|
|
|
@ -360,6 +360,7 @@ typedef struct {
|
||||||
int zackariaSuspicionLevel;
|
int zackariaSuspicionLevel;
|
||||||
int destroyTorelli;
|
int destroyTorelli;
|
||||||
float torelliFireStormAlpha;
|
float torelliFireStormAlpha;
|
||||||
|
int campaignFinished;
|
||||||
Entity *missionTarget;
|
Entity *missionTarget;
|
||||||
Entity *jumpgate;
|
Entity *jumpgate;
|
||||||
Entity *messageSpeaker;
|
Entity *messageSpeaker;
|
||||||
|
|
Loading…
Reference in New Issue