Centralized mission failure logic.
This commit is contained in:
parent
1f62eb2564
commit
1760c9e3b3
|
@ -79,8 +79,6 @@ void doObjectives(void)
|
|||
if (objectiveFailed)
|
||||
{
|
||||
failMission();
|
||||
|
||||
failIncompleteObjectives();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue