From c9632613cefb79b0aa0ef49552ae6aafdd52156d Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 14 Nov 2015 16:14:48 +0000 Subject: [PATCH] Updated EF_DISABLE to EF_DISABLED. Fixed objective logic for disabled craft (fire only once). --- src/battle/ai.c | 4 ++-- src/battle/fighters.c | 3 ++- src/defs.h | 2 +- src/system/lookup.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/battle/ai.c b/src/battle/ai.c index b53797d..aaadabc 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -26,7 +26,7 @@ static int aggression[][5] = {50, 55, 60, 65, 70}, {40, 45, 50, 55, 60}, {30, 35, 40, 45, 50}, - {20, 25, 30, 35, 40} + {15, 20, 25, 30, 35} }; static void faceTarget(Entity *f); @@ -192,7 +192,7 @@ static int canAttack(Entity *f) { self->selectedGunType = self->guns[0].type; - if (f->flags & EF_DISABLE) + if (f->flags & EF_DISABLED) { if (f->systemPower > 0) { diff --git a/src/battle/fighters.c b/src/battle/fighters.c index 5a61e55..56dfc43 100644 --- a/src/battle/fighters.c +++ b/src/battle/fighters.c @@ -215,8 +215,9 @@ void doFighter(void) self->shield = self->maxShield = 0; self->action = NULL; - if (self->alive == ALIVE_ALIVE) + if ((self->flags & EF_DISABLED) == 0) { + self->flags |= EF_DISABLED; updateObjective(self->name, TT_DISABLE); battle.stats[STAT_DISABLED]++; } diff --git a/src/defs.h b/src/defs.h index 798505c..646ca81 100644 --- a/src/defs.h +++ b/src/defs.h @@ -64,7 +64,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define EF_NONE 0 #define EF_NO_KILL (2 << 0) -#define EF_DISABLE (2 << 1) +#define EF_DISABLED (2 << 1) #define EF_IMMORTAL (2 << 2) #define EF_MISSION_TARGET (2 << 3) #define EF_FLEES (2 << 4) diff --git a/src/system/lookup.c b/src/system/lookup.c index ccdc6af..2d23a8c 100644 --- a/src/system/lookup.c +++ b/src/system/lookup.c @@ -34,7 +34,7 @@ void initLookups(void) addLookup("ET_EXTRACTION_POINT", ET_EXTRACTION_POINT); addLookup("EF_NO_KILL", EF_NO_KILL); - addLookup("EF_DISABLE", EF_DISABLE); + addLookup("EF_DISABLED", EF_DISABLED); addLookup("EF_IMMORTAL", EF_IMMORTAL); addLookup("EF_MISSION_TARGET", EF_MISSION_TARGET); addLookup("EF_FLEES", EF_FLEES);