diff --git a/data/missions/alba/01 - patrol #1.json b/data/missions/alba/01 - patrol #1.json index 8fcb918..206968b 100644 --- a/data/missions/alba/01 - patrol #1.json +++ b/data/missions/alba/01 - patrol #1.json @@ -8,7 +8,7 @@ "manualComplete" : 1, "objectives" : [ { - "description" : "Check all wayponts", + "description" : "Check all waypoints", "targetName" : "Waypoint", "targetValue" : 5, "targetType" : "TT_WAYPOINT" @@ -42,6 +42,12 @@ } ], "script" : [ + { + "function" : "TIME 0", + "lines" : [ + "ACTIVATE_NEXT_WAYPOINT" + ] + } { "function" : "Waypoint #2", "lines" : [ diff --git a/data/missions/alba/02 - patrol #2.json b/data/missions/alba/02 - patrol #2.json index f586241..74a8b56 100644 --- a/data/missions/alba/02 - patrol #2.json +++ b/data/missions/alba/02 - patrol #2.json @@ -59,6 +59,12 @@ } ], "script" : [ + { + "function" : "TIME 0", + "lines" : [ + "ACTIVATE_NEXT_WAYPOINT" + ] + }, { "function" : "Waypoint #3", "lines" : [ diff --git a/data/missions/alba/03 - patrol #3.json b/data/missions/alba/03 - patrol #3.json index fe1ccb2..32e6290 100644 --- a/data/missions/alba/03 - patrol #3.json +++ b/data/missions/alba/03 - patrol #3.json @@ -45,6 +45,12 @@ } ], "script" : [ + { + "function" : "TIME 0", + "lines" : [ + "ACTIVATE_NEXT_WAYPOINT" + ] + }, { "function" : "TIME 3", "lines" : [ diff --git a/data/missions/granada/02 - suspect packages #2.json b/data/missions/granada/02 - suspect packages #2.json index 5e6a208..8c83f4e 100644 --- a/data/missions/granada/02 - suspect packages #2.json +++ b/data/missions/granada/02 - suspect packages #2.json @@ -126,6 +126,12 @@ } ], "script" : [ + { + "function" : "TIME 0", + "lines" : [ + "ACTIVATE_NEXT_WAYPOINT" + ] + }, { "function" : "Waypoint #2", "lines" : [ diff --git a/data/missions/granada/03 - suspect packages #3.json b/data/missions/granada/03 - suspect packages #3.json index 87663cf..ef8e8e5 100644 --- a/data/missions/granada/03 - suspect packages #3.json +++ b/data/missions/granada/03 - suspect packages #3.json @@ -126,6 +126,12 @@ } ], "script" : [ + { + "function" : "TIME 0", + "lines" : [ + "ACTIVATE_NEXT_WAYPOINT" + ] + }, { "function" : "Waypoint #1", "lines" : [ diff --git a/src/battle/script.c b/src/battle/script.c index 4cb3252..73e195c 100644 --- a/src/battle/script.c +++ b/src/battle/script.c @@ -213,6 +213,10 @@ static void executeNextLine(ScriptRunner *runner) { battle.jumpgate->systemPower = MAX_SYSTEM_POWER; } + else if (strcmp(command, "ACTIVATE_NEXT_WAYPOINT") == 0) + { + activateNextWaypoint(0); + } else if (strcmp(command, "MSG_BOX") == 0) { sscanf(line, "%*s %255[^;]%*c%255[^\n]", strParam[0], strParam[1]); @@ -273,6 +277,8 @@ void destroyScript(void) if (scriptJSON) { cJSON_Delete(scriptJSON); + + scriptJSON = NULL; } while (head.next) diff --git a/src/battle/script.h b/src/battle/script.h index acbceb6..2f05ea9 100644 --- a/src/battle/script.h +++ b/src/battle/script.h @@ -35,6 +35,7 @@ void activateObjectives(char *objectives); extern int showingMessageBoxes(void); extern char *getTranslatedString(char *string); extern void spawnScriptFighter(char *fighters, char *side, int num, char *location); +extern void activateNextWaypoint(int id); extern Battle battle; extern Colors colors; diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index ee89fb9..6529aaa 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -216,8 +216,6 @@ void loadMission(char *filename) battle.status = MS_IN_PROGRESS; } - activateNextWaypoint(); - countNumEnemies(); initPlayer(); diff --git a/src/galaxy/mission.h b/src/galaxy/mission.h index 998712e..c6a8647 100644 --- a/src/galaxy/mission.h +++ b/src/galaxy/mission.h @@ -35,7 +35,6 @@ extern void stopMusic(void); extern void initPlayer(void); extern long flagsToLong(char *flags, int *add); extern Entity *spawnWaypoint(void); -extern void activateNextWaypoint(void); extern void selectWidget(const char *name, const char *group); extern Entity *spawnJumpgate(void); extern Entity *spawnItem(char *type);