Don't allow waypoints to be triggers if there are outstanding objectives.

This commit is contained in:
Steve 2015-11-28 15:07:12 +00:00
parent e13243d926
commit 403684b0dd
1 changed files with 16 additions and 1 deletions

View File

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static void think(void);
static int teamMatesClose(void);
static int isCurrentObjective(void);
void activateNextWaypoint(int id);
static int waypointId;
@ -57,7 +58,7 @@ static void think(void)
self->angle -= 360;
}
if (player != NULL && getDistance(player->x, player->y, self->x, self->y) <= 64 && teamMatesClose())
if (player != NULL && getDistance(player->x, player->y, self->x, self->y) <= 64 && isCurrentObjective() && teamMatesClose())
{
self->health = 0;
@ -69,6 +70,20 @@ static void think(void)
}
}
static int isCurrentObjective(void)
{
int numActiveObjectives = battle.numObjectivesTotal - battle.numObjectivesComplete;
if (numActiveObjectives > 1)
{
addHudMessage(colors.cyan, "Cannot activate waypoint - outstanding objectives not yet complete");
self->thinkTime = FPS;
return 0;
}
return 1;
}
static int teamMatesClose(void)
{
Entity *e;