diff --git a/src/battle/capitalShips.c b/src/battle/capitalShips.c index 757e60a..9b5c37d 100644 --- a/src/battle/capitalShips.c +++ b/src/battle/capitalShips.c @@ -519,7 +519,7 @@ static void loadEngines(Entity *parent, cJSON *engines) } } -void updateCapitalShipComponentNames(Entity *parent) +void updateCapitalShipComponentProperties(Entity *parent) { Entity *e; @@ -541,6 +541,8 @@ void updateCapitalShipComponentNames(Entity *parent) sprintf(e->name, "%s (Gun)", parent->name); break; } + + e->active = parent->active; } } } diff --git a/src/battle/entities.c b/src/battle/entities.c index cf6d36d..3b2b069 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -428,6 +428,11 @@ void activateEntities(char *names) if (strcmp(e->name, name) == 0) { e->active = 1; + + if (e->type == ET_CAPITAL_SHIP) + { + updateCapitalShipComponentProperties(e); + } } } diff --git a/src/battle/entities.h b/src/battle/entities.h index d3b39dd..9aa52c3 100644 --- a/src/battle/entities.h +++ b/src/battle/entities.h @@ -31,6 +31,7 @@ extern void drawRope(Entity *e); extern void cutRope(Entity *e); extern void drawShieldHitEffect(Entity *e); extern void destroyGrid(void); +extern void updateCapitalShipComponentProperties(Entity *parent); extern App app; extern Battle battle; diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index f3f79df..dba2b04 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -423,7 +423,7 @@ static void loadCapitalShips(cJSON *node) } } - updateCapitalShipComponentNames(e); + updateCapitalShipComponentProperties(e); } node = node->next; diff --git a/src/galaxy/mission.h b/src/galaxy/mission.h index 09de96d..14c53ab 100644 --- a/src/galaxy/mission.h +++ b/src/galaxy/mission.h @@ -45,7 +45,7 @@ extern void completeConditions(void); extern void retreatEnemies(void); extern void initScript(cJSON *missionJSON); extern char *getFileLocation(char *filename); -extern void updateCapitalShipComponentNames(Entity *parent); +extern void updateCapitalShipComponentProperties(Entity *parent); extern Battle battle; extern Dev dev;