Disable capital ship itself, when gun and engines are destroyed (not just components).

This commit is contained in:
Steve 2016-05-23 09:18:10 +01:00
parent 2a725471c7
commit 108a41310c
2 changed files with 3 additions and 2 deletions

View File

@ -135,7 +135,7 @@ static void think(void)
self->angle += dir; self->angle += dir;
self->angle = fmod(self->angle, 360); self->angle = mod(self->angle, 360);
} }
applyFighterThrust(); applyFighterThrust();
@ -387,7 +387,7 @@ static void disable(void)
for (e = battle.entityHead.next ; e != NULL ; e = e->next) for (e = battle.entityHead.next ; e != NULL ; e = e->next)
{ {
if (e->owner == self->owner) if (e->owner == self->owner || e == self->owner)
{ {
e->systemPower = 0; e->systemPower = 0;
e->flags |= EF_DISABLED; e->flags |= EF_DISABLED;

View File

@ -49,6 +49,7 @@ extern void addLargeExplosion(void);
extern char **toTypeArray(char *types, int *numTypes); extern char **toTypeArray(char *types, int *numTypes);
extern void updateCondition(char *name, int type); extern void updateCondition(char *name, int type);
extern void addMessageBox(char *title, char *body, int type); extern void addMessageBox(char *title, char *body, int type);
extern float mod(float n, float x);
extern Battle battle; extern Battle battle;
extern Entity *player; extern Entity *player;