diff --git a/src/battle/entities.c b/src/battle/entities.c index f3a7155..3a163c2 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -63,6 +63,7 @@ void doEntities(void) { int numAllies, numEnemies; int numActiveAllies, numActiveEnemies; + int numSpawnedEnemies; Entity *e, *prev; prev = &battle.entityHead; @@ -217,6 +218,11 @@ void doEntities(void) if (e->health > 0 && e->active) { numActiveEnemies++; + + if (e->spawned) + { + numSpawnedEnemies++; + } } } } @@ -229,6 +235,8 @@ void doEntities(void) if (battle.isEpic && battle.stats[STAT_TIME] % FPS == 0) { + numActiveEnemies -= numSpawnedEnemies; + if (numAllies > battle.epicFighterLimit) { activateEpicFighters(battle.epicFighterLimit - numActiveAllies, SIDE_ALLIES); diff --git a/src/battle/spawners.c b/src/battle/spawners.c index b25c053..fda46dd 100644 --- a/src/battle/spawners.c +++ b/src/battle/spawners.c @@ -40,7 +40,10 @@ void doSpawners(void) s->total -= num; } - battle.numInitialEnemies += num; + if (s->side != SIDE_ALLIES) + { + battle.numInitialEnemies += num; + } for (i = 0 ; i < num ; i++) { @@ -48,6 +51,8 @@ void doSpawners(void) e = spawnFighter(type, 0, 0, s->side); + e->spawned = 1; + if (s->offscreen) { e->x = player->x; diff --git a/src/structs.h b/src/structs.h index c909afd..65a9e74 100644 --- a/src/structs.h +++ b/src/structs.h @@ -100,6 +100,7 @@ struct Entity { char defName[MAX_NAME_LENGTH]; char groupName[MAX_NAME_LENGTH]; int active; + int spawned; int id; int side; float x;