remove battle statistics, the flag is not set anywhere, and I have not used them in ages.

This commit is contained in:
Enno Rehling 2014-07-05 10:45:03 -07:00
parent 990b6505bf
commit d5e9899544
1 changed files with 0 additions and 67 deletions

View File

@ -4057,70 +4057,6 @@ static bool start_battle(region * r, battle ** bp)
return fighting; return fighting;
} }
static void battle_stats(FILE * F, battle * b)
{
typedef struct stat_info {
struct stat_info *next;
const weapon_type *wtype;
int level;
int number;
} stat_info;
side *s;
for (s = b->sides; s != b->sides + b->nsides; ++s) {
fighter *df;
stat_info *stats = NULL, *stat;
for (df = s->fighters; df; df = df->next) {
unit *du = df->unit;
troop dt;
stat_info *slast = NULL;
dt.fighter = df;
for (dt.index = 0; dt.index != du->number; ++dt.index) {
weapon *wp = preferred_weapon(dt, true);
int level = wp ? wp->attackskill : 0;
const weapon_type *wtype = wp ? wp->type : NULL;
stat_info **slist = &stats;
if (slast && slast->wtype == wtype && slast->level == level) {
++slast->number;
continue;
}
while (*slist && (*slist)->wtype != wtype) {
slist = &(*slist)->next;
}
while (*slist && (*slist)->wtype == wtype && (*slist)->level > level) {
slist = &(*slist)->next;
}
stat = *slist;
if (stat == NULL || stat->wtype != wtype || stat->level != level) {
stat = (stat_info*)calloc(1, sizeof(stat_info));
stat->wtype = wtype;
stat->level = level;
stat->next = *slist;
*slist = stat;
}
slast = stat;
++slast->number;
}
}
fprintf(F, "##STATS## Heer %u - %s:\n", army_index(s),
factionname(s->faction));
for (stat = stats; stat != NULL; stat = stat->next) {
fprintf(F, "%s %u : %u\n",
stat->wtype ? stat->wtype->itype->rtype->_name[0] : "none", stat->level,
stat->number);
}
while (stats) {
stat_info *stat = stats;
stats = stat->next;
free(stat);
}
}
}
/** execute one round of attacks /** execute one round of attacks
* fig->fighting is used to determine who attacks, not fig->alive, since * fig->fighting is used to determine who attacks, not fig->alive, since
* the latter may be influenced by attacks that already took place. * the latter may be influenced by attacks that already took place.
@ -4289,9 +4225,6 @@ void do_battle(region * r)
b->has_tactics_turn = false; b->has_tactics_turn = false;
} }
if (b->region->flags & RF_COMBATDEBUG)
battle_stats(bdebug, b);
/* PRECOMBATSPELLS */ /* PRECOMBATSPELLS */
do_combatmagic(b, DO_PRECOMBATSPELL); do_combatmagic(b, DO_PRECOMBATSPELL);