When activating a captial ship, also activate its components.
This commit is contained in:
parent
4652787b65
commit
b095705dd0
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -423,7 +423,7 @@ static void loadCapitalShips(cJSON *node)
|
|||
}
|
||||
}
|
||||
|
||||
updateCapitalShipComponentNames(e);
|
||||
updateCapitalShipComponentProperties(e);
|
||||
}
|
||||
|
||||
node = node->next;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue