From f7c1aa6f1b94e9da8cb03913c5cee5cbf4ad6b0c Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 16 Apr 2016 08:59:14 +0100 Subject: [PATCH] Update conditions when capital ships are destroyed. --- src/battle/capitalShips.c | 6 ++++-- src/battle/capitalShips.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/battle/capitalShips.c b/src/battle/capitalShips.c index f88446f..126658a 100644 --- a/src/battle/capitalShips.c +++ b/src/battle/capitalShips.c @@ -318,8 +318,8 @@ static void die(void) } updateObjective(self->name, TT_DESTROY); - - updateObjective(self->groupName, TT_DESTROY); + + updateCondition(self->name, TT_DESTROY); } static void handleDisabled(void) @@ -662,6 +662,8 @@ void loadCapitalShips(cJSON *node) updateCapitalShipComponentProperties(e, flags); } + + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "%s (%d / %d)", e->name, e->health, e->maxHealth); } node = node->next; diff --git a/src/battle/capitalShips.h b/src/battle/capitalShips.h index a40c954..b69ad41 100644 --- a/src/battle/capitalShips.h +++ b/src/battle/capitalShips.h @@ -51,6 +51,7 @@ extern char *getJSONValueStr(cJSON *node, char *name, char *defValue); extern char *getTranslatedString(char *string); extern void addLargeExplosion(void); extern char **toTypeArray(char *types, int *numTypes); +extern void updateCondition(char *name, int type); extern Battle battle; extern Entity *self;