From e62676711d7339dc9518acb5cc8567490b97667b Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 29 Apr 2016 08:42:10 +0100 Subject: [PATCH] Award post mission trophies upon mission completion. --- src/battle/battle.c | 13 ------------- src/galaxy/mission.c | 5 +++++ src/galaxy/mission.h | 1 + 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/battle/battle.c b/src/battle/battle.c index 7c29a06..08b943f 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -387,19 +387,6 @@ static void postBattle(void) game.stats[STAT_EPIC_KILL_STREAK] = MAX(game.stats[STAT_EPIC_KILL_STREAK], battle.stats[STAT_EPIC_KILL_STREAK]); updateAccuracyStats(game.stats); - - if (!game.currentMission->challengeData.isChallenge) - { - if (game.currentMission && !game.currentMission->completed) - { - game.currentMission->completed = (battle.status == MS_COMPLETE || !battle.numObjectivesTotal); - - if (game.currentMission->completed) - { - awardPostMissionTrophies(); - } - } - } } void destroyBattle(void) diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index 4cc7945..d284feb 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -264,6 +264,11 @@ void completeMission(void) player->flags |= EF_IMMORTAL; awardStatsTrophies(); + + if (!game.currentMission->challengeData.isChallenge) + { + awardPostMissionTrophies(); + } } } diff --git a/src/galaxy/mission.h b/src/galaxy/mission.h index 6f00ebc..c616bdd 100644 --- a/src/galaxy/mission.h +++ b/src/galaxy/mission.h @@ -61,6 +61,7 @@ extern void loadChallenge(Mission *mission, cJSON *node); extern Entity *spawnMine(int type); extern void activateNextWaypoint(void); extern void awardStatsTrophies(void); +extern void awardPostMissionTrophies(void); extern Battle battle; extern Dev dev;