- report_building() faster

- indentation cleanup
This commit is contained in:
Enno Rehling 2006-02-20 21:24:09 +00:00
parent b7552f0d06
commit 2ab8cc7564
4 changed files with 197 additions and 196 deletions

View File

@ -4051,7 +4051,6 @@ processorders (void)
puts(" - Neue Nummern");
renumber();
for (r = regions;r;r=r->next) reorder_owners(r);
puts(" - Attribute altern");

View File

@ -550,6 +550,7 @@ rpunit(FILE * F, const faction * f, const unit * u, int indent, int mode)
char marker;
int dh;
boolean isbattle = (boolean)(mode == see_battle);
if (u->race == new_race[RC_SPELL]) return;
{
@ -579,7 +580,6 @@ rpunit(FILE * F, const faction * f, const unit * u, int indent, int mode)
if (!isbattle) {
print_curses(F, f, u, TYP_UNIT, indent);
}
}
static void
@ -1658,8 +1658,9 @@ report_building(FILE *F, const region * r, const building * b, const faction * f
#ifdef WDW_PYRAMID
if (i != '!' && i != '?' && i != '.')
if (i != '!' && i != '?' && i != '.') {
scat(", ");
}
if (b->type == bt_find("pyramid")) {
unit * owner = buildingowner(r, b);
@ -1718,15 +1719,18 @@ report_building(FILE *F, const region * r, const building * b, const faction * f
print_curses(F, f, b, TYP_BUILDING, 4);
for (u = r->units; u; u = u->next)
if (u->building == b && fval(u, UFL_OWNER)) {
for (u = r->units; u; u = u->next) {
if (u->building == b) {
assert(fval(u, UFL_OWNER) || !"you must call reorder_owners() first!");
rpunit(F, f, u, 6, mode);
u = u->next;
break;
}
for (u = r->units; u; u = u->next)
if (u->building == b && !fval(u, UFL_OWNER))
}
for (;u!=NULL && u->building==b;u=u->next) {
rpunit(F, f, u, 6, mode);
}
}
int
report_plaintext(const char * filename, report_context * ctx)

View File

@ -303,16 +303,14 @@ racename(const struct locale *loc, const unit *u, const race * rc)
strcpy(lbuf, locale_string(loc, mkname("prefix", prefix)));
s += strlen(lbuf);
if (asyn!=NULL) {
strcpy(s, locale_string(loc,
((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
strcpy(s, LOC(loc, ((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
} else {
strcpy(s, LOC(loc, rc_name(rc, u->number != 1)));
}
s[0] = (char)tolower(s[0]);
return lbuf;
} else if (asyn!=NULL) {
return(locale_string(loc,
((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
return(LOC(loc, ((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
}
return LOC(loc, rc_name(rc, u->number != 1));
}