diff --git a/src/battle/waypoints.c b/src/battle/waypoints.c index 939aeab..11e086c 100644 --- a/src/battle/waypoints.c +++ b/src/battle/waypoints.c @@ -96,6 +96,13 @@ static int isCurrentObjective(void) return 0; } + if (game.currentMission->challengeData.isChallenge && game.currentMission->challengeData.clearWaypointEnemies && battle.numEnemies > 0) + { + addHudMessage(colors.cyan, _("Cannot activate waypoint - eliminate enemies first")); + self->aiActionTime = FPS; + return 0; + } + return 1; } diff --git a/src/battle/waypoints.h b/src/battle/waypoints.h index 63862c8..00cfd14 100644 --- a/src/battle/waypoints.h +++ b/src/battle/waypoints.h @@ -32,3 +32,4 @@ extern Battle battle; extern Colors colors; extern Entity *self; extern Entity *player; +extern Game game; diff --git a/src/challenges/challenges.c b/src/challenges/challenges.c index 8af293f..9fd474e 100644 --- a/src/challenges/challenges.c +++ b/src/challenges/challenges.c @@ -113,6 +113,7 @@ void loadChallenge(Mission *mission, cJSON *node) /* misc */ mission->challengeData.allowPlayerDeath = getJSONValue(node, "allowPlayerDeath", 0); + mission->challengeData.clearWaypointEnemies = getJSONValue(node, "clearWaypointEnemies", 0); node = cJSON_GetObjectItem(node, "challenges"); diff --git a/src/structs.h b/src/structs.h index 76cb24d..f3abe58 100644 --- a/src/structs.h +++ b/src/structs.h @@ -263,6 +263,7 @@ typedef struct { int noGuns; int scriptedEnd; int allowPlayerDeath; + int clearWaypointEnemies; Challenge *challenges[MAX_CHALLENGES]; } ChallengeData;