Allow fighters to be added to mission in disabled state.

This commit is contained in:
Steve 2016-03-09 23:21:28 +00:00
parent 46503f4fe7
commit 8017719239
1 changed files with 8 additions and 1 deletions

View File

@ -376,7 +376,7 @@ static void loadFighters(cJSON *node)
Entity *e; Entity *e;
char **types, *name, *groupName, *type; char **types, *name, *groupName, *type;
int side, scatter, number, active; int side, scatter, number, active;
int i, numTypes, addFlags, addAIFlags; int i, numTypes, addFlags, addAIFlags, systemPower;
long flags, aiFlags; long flags, aiFlags;
float x, y; float x, y;
@ -400,6 +400,7 @@ static void loadFighters(cJSON *node)
number = getJSONValue(node, "number", 1); number = getJSONValue(node, "number", 1);
scatter = getJSONValue(node, "scatter", 1); scatter = getJSONValue(node, "scatter", 1);
active = getJSONValue(node, "active", 1); active = getJSONValue(node, "active", 1);
systemPower = getJSONValue(node, "systemPower", MAX_SYSTEM_POWER);
if (cJSON_GetObjectItem(node, "flags")) if (cJSON_GetObjectItem(node, "flags"))
{ {
@ -462,6 +463,12 @@ static void loadFighters(cJSON *node)
{ {
STRNCPY(e->groupName, groupName, MAX_NAME_LENGTH); STRNCPY(e->groupName, groupName, MAX_NAME_LENGTH);
} }
e->systemPower = systemPower;
if (!e->systemPower)
{
e->flags |= EF_DISABLED;
}
} }
node = node->next; node = node->next;