Komische 'Kämpft gegen' Zeile (und Attackiert)
Issue: 563
This commit is contained in:
Enno Rehling 2005-06-26 13:16:49 +00:00
parent e6c5c45910
commit 2cebb01c99
1 changed files with 11 additions and 13 deletions

View File

@ -2741,7 +2741,6 @@ print_stats(battle * b)
cv_foreach(side, b->sides) { cv_foreach(side, b->sides) {
bfaction *bf; bfaction *bf;
char *k; char *k;
boolean komma;
++i; ++i;
@ -2749,8 +2748,9 @@ print_stats(battle * b)
faction * f = bf->faction; faction * f = bf->faction;
const char * loc_army = LOC(f->locale, "battle_army"); const char * loc_army = LOC(f->locale, "battle_army");
char * bufp; char * bufp;
const char * header = LOC(f->locale, "battle_opponents"); const char * header;
size_t rsize, size; size_t rsize, size;
int komma;
fbattlerecord(b, f, " "); fbattlerecord(b, f, " ");
@ -2760,33 +2760,31 @@ print_stats(battle * b)
bufp = buf; bufp = buf;
size = sizeof(buf); size = sizeof(buf);
komma = 0;
header = LOC(f->locale, "battle_opponents");
komma = false;
cv_foreach(s2, b->sides) { cv_foreach(s2, b->sides) {
if (enemy(s2, side)) { if (enemy(s2, side)) {
const char * abbrev = seematrix(f, s2)?sideabkz(s2, false):"-?-"; const char * abbrev = seematrix(f, s2)?sideabkz(s2, false):"-?-";
rsize = slprintf(bufp, size, "%s%s %s %d(%s)", header, rsize = slprintf(bufp, size, "%s %s %d(%s)",
komma++ ? "," : "", loc_army, s2->index, abbrev); komma++ ? "," : header, loc_army, s2->index, abbrev);
if (rsize>size) rsize = size-1; if (rsize>size) rsize = size-1;
size -= rsize; size -= rsize;
bufp += rsize; bufp += rsize;
} }
} }
cv_next(s2); cv_next(s2);
fbattlerecord(b, f, buf); if (komma) fbattlerecord(b, f, buf);
bufp = buf; bufp = buf;
size = sizeof(buf); size = sizeof(buf);
rsize = strlcpy(buf, LOC(f->locale, "battle_attack"), size); komma = 0;
if (rsize>size) rsize = size-1; header = LOC(f->locale, "battle_attack");
size -= rsize;
bufp += rsize;
komma = false;
cv_foreach(s2, b->sides) { cv_foreach(s2, b->sides) {
if (side->enemy[s2->index] & E_ATTACKING) { if (side->enemy[s2->index] & E_ATTACKING) {
const char * abbrev = seematrix(f, s2)?sideabkz(s2, false):"-?-"; const char * abbrev = seematrix(f, s2)?sideabkz(s2, false):"-?-";
rsize = slprintf(bufp, size, "%s%s %s %d(%s)", buf, komma++ ? "," : "", loc_army, rsize = slprintf(bufp, size, "%s %s %d(%s)", komma++ ? "," : header, loc_army,
s2->index, abbrev); s2->index, abbrev);
if (rsize>size) rsize = size-1; if (rsize>size) rsize = size-1;
size -= rsize; size -= rsize;
@ -2794,7 +2792,7 @@ print_stats(battle * b)
} }
} }
cv_next(s2); cv_next(s2);
fbattlerecord(b, f, buf); if (komma) fbattlerecord(b, f, buf);
} }
buf[77] = (char)0; buf[77] = (char)0;
for (k = buf; *k; ++k) *k = '-'; for (k = buf; *k; ++k) *k = '-';