Centralized mission failure logic.

This commit is contained in:
Steve 2015-11-14 08:41:31 +00:00
parent 1f62eb2564
commit 1760c9e3b3
4 changed files with 4 additions and 10 deletions

View File

@ -79,8 +79,6 @@ void doObjectives(void)
if (objectiveFailed)
{
failMission();
failIncompleteObjectives();
}
}
}

View File

@ -132,10 +132,7 @@ void doPlayer(void)
{
if (!battle.epic)
{
failIncompleteObjectives();
battle.status = MS_FAILED;
battle.missionFinishedTimer = FPS;
failMission();
}
else if (player->health == -FPS)
{
@ -171,10 +168,7 @@ void initPlayerSelect(void)
{
battle.epic = 0;
failIncompleteObjectives();
battle.status = MS_FAILED;
battle.missionFinishedTimer = FPS;
failMission();
}
}

View File

@ -33,6 +33,7 @@ extern int getDistance(int x1, int y1, int x2, int y2);
extern void failIncompleteObjectives(void);
extern void addHudMessage(SDL_Color c, char *format, ...);
extern int mod(int n, int x);
extern void failMission(void);
extern App app;
extern Battle battle;

View File

@ -39,6 +39,7 @@ extern Entity *spawnWaypoint(void);
extern void activateNextWaypoint(void);
extern void selectWidget(const char *name, const char *group);
extern Entity *spawnExtractionPoint(void);
extern void failIncompleteObjectives(void);
extern Battle battle;
extern Entity *player;