Durchreisemeldungen fehlen

Kleiner Bug bei der Änderung von attrib::nexttype
This commit is contained in:
Enno Rehling 2006-02-26 11:59:58 +00:00
parent 23247f1831
commit caab8471ed
1 changed files with 49 additions and 51 deletions

View File

@ -1146,63 +1146,61 @@ statistics(FILE * F, const region * r, const faction * f)
static void static void
durchreisende(FILE * F, const region * r, const faction * f) durchreisende(FILE * F, const region * r, const faction * f)
{ {
attrib *ru;
int maxtravel;
int counter;
maxtravel = counter = 0;
/* Wieviele sind aufzulisten? Für die Grammatik. */
if (fval(r, RF_TRAVELUNIT)) { if (fval(r, RF_TRAVELUNIT)) {
for (ru = a_find(r->attribs, &at_travelunit); ru && ru->type!=&at_travelunit; ru = ru->next) { attrib *abegin = a_find(r->attribs, &at_travelunit), *a;
unit * u = (unit*)ru->data.v; int counter = 0, maxtravel = 0;
if (cansee_durchgezogen(f, r, u, 0) > 0 && r!=u->region) { char * str = buf;
if (u->ship && !fval(u, UFL_OWNER))
continue; /* Wieviele sind aufzulisten? Für die Grammatik. */
maxtravel++; for (a = abegin; a && a->type==&at_travelunit; a = a->next) {
unit * u = (unit*)a->data.v;
if (r!=u->region && (u->ship==NULL || fval(u, UFL_OWNER))) {
if (cansee_durchgezogen(f, r, u, 0)) {
++maxtravel;
}
} }
} }
if (!maxtravel) if (maxtravel==0) {
return; return;
} else return; }
/* Auflisten. */ /* Auflisten. */
*str = '\0';
rnl(F);
buf[0] = 0; for (a = abegin; a && a->type==&at_travelunit; a = a->next) {
rnl(F); unit * u = (unit*)a->data.v;
for (ru = a_find(r->attribs, &at_travelunit); ru && ru->type==&at_travelunit; ru = ru->next) { if (r!=u->region && (u->ship==NULL || fval(u, UFL_OWNER))) {
unit * u = (unit*)ru->data.v; if (cansee_durchgezogen(f, r, u, 0)) {
if (cansee_durchgezogen(f, r, u, 0) > 0 && r!=u->region) { ++counter;
if (u->ship && !fval(u, UFL_OWNER)) if (u->ship != NULL) {
continue; if (counter == 1) {
counter++; str += strxcpy(str, "Die ");
if (u->ship != (ship *) NULL) { } else {
if (counter == 1) { str += strxcpy(str, "die ");
scat("Die "); }
} else { str += strxcpy(str, shipname(u->ship));
scat("die "); } else {
} str += strxcpy(str, unitname(u));
scat(shipname(u->ship)); }
} else { if (counter + 1 < maxtravel) {
scat(unitname(u)); str += strxcpy(str, ", ");
} } else if (counter + 1 == maxtravel) {
if (counter + 1 < maxtravel) { str += strxcpy(str, "und ");
scat(", "); }
} else if (counter + 1 == maxtravel) { }
scat(" und "); }
} }
} if (maxtravel == 1) {
} str += strxcpy(str, " hat die Region durchquert.");
rparagraph(F, buf, 0, 0, 0);
if (maxtravel == 1) { } else {
scat(" hat die Region durchquert."); str += strxcpy(str, " haben die Region durchquert.");
rparagraph(F, buf, 0, 0, 0); rparagraph(F, buf, 0, 0, 0);
} else { }
scat(" haben die Region durchquert.");
rparagraph(F, buf, 0, 0, 0);
} }
} }