From 8017719239432c7ee9b1df0990123bcca52c166c Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 9 Mar 2016 23:21:28 +0000 Subject: [PATCH] Allow fighters to be added to mission in disabled state. --- src/galaxy/mission.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index 8c3ea1c..9ada9e3 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -376,7 +376,7 @@ static void loadFighters(cJSON *node) Entity *e; char **types, *name, *groupName, *type; int side, scatter, number, active; - int i, numTypes, addFlags, addAIFlags; + int i, numTypes, addFlags, addAIFlags, systemPower; long flags, aiFlags; float x, y; @@ -400,6 +400,7 @@ static void loadFighters(cJSON *node) number = getJSONValue(node, "number", 1); scatter = getJSONValue(node, "scatter", 1); active = getJSONValue(node, "active", 1); + systemPower = getJSONValue(node, "systemPower", MAX_SYSTEM_POWER); if (cJSON_GetObjectItem(node, "flags")) { @@ -462,6 +463,12 @@ static void loadFighters(cJSON *node) { STRNCPY(e->groupName, groupName, MAX_NAME_LENGTH); } + + e->systemPower = systemPower; + if (!e->systemPower) + { + e->flags |= EF_DISABLED; + } } node = node->next;