Manual mission complete bug fix.

This commit is contained in:
Steve 2016-05-22 12:08:48 +01:00
parent 41aff3ee3c
commit cda791cfe8
1 changed files with 15 additions and 3 deletions

View File

@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "objectives.h"
static int fireObjectivesComplete;
void doObjectives(void)
{
int objectiveFailed;
@ -76,11 +78,19 @@ void doObjectives(void)
if (battle.status == MS_IN_PROGRESS)
{
if (!battle.manualComplete && !hasHidden && battle.numObjectivesTotal > 0 && battle.numObjectivesComplete == battle.numObjectivesTotal)
if (!hasHidden && battle.numObjectivesTotal > 0 && battle.numObjectivesComplete == battle.numObjectivesTotal)
{
runScriptFunction("ALL_OBJECTIVES_COMPLETE");
if (fireObjectivesComplete)
{
runScriptFunction("ALL_OBJECTIVES_COMPLETE");
fireObjectivesComplete = 0;
}
completeMission();
if (!battle.manualComplete)
{
completeMission();
}
}
if (objectiveFailed)
@ -290,4 +300,6 @@ void loadObjectives(cJSON *node)
node = node->next;
}
}
fireObjectivesComplete = 1;
}