forked from github/server
- report_building() faster
- indentation cleanup
This commit is contained in:
parent
b7552f0d06
commit
2ab8cc7564
4 changed files with 197 additions and 196 deletions
|
@ -4051,7 +4051,6 @@ processorders (void)
|
||||||
|
|
||||||
puts(" - Neue Nummern");
|
puts(" - Neue Nummern");
|
||||||
renumber();
|
renumber();
|
||||||
|
|
||||||
for (r = regions;r;r=r->next) reorder_owners(r);
|
for (r = regions;r;r=r->next) reorder_owners(r);
|
||||||
|
|
||||||
puts(" - Attribute altern");
|
puts(" - Attribute altern");
|
||||||
|
|
|
@ -550,7 +550,8 @@ rpunit(FILE * F, const faction * f, const unit * u, int indent, int mode)
|
||||||
char marker;
|
char marker;
|
||||||
int dh;
|
int dh;
|
||||||
boolean isbattle = (boolean)(mode == see_battle);
|
boolean isbattle = (boolean)(mode == see_battle);
|
||||||
if(u->race == new_race[RC_SPELL]) return;
|
|
||||||
|
if (u->race == new_race[RC_SPELL]) return;
|
||||||
|
|
||||||
{
|
{
|
||||||
rnl(F);
|
rnl(F);
|
||||||
|
@ -559,14 +560,14 @@ rpunit(FILE * F, const faction * f, const unit * u, int indent, int mode)
|
||||||
|
|
||||||
a_otherfaction = a_find(u->attribs, &at_otherfaction);
|
a_otherfaction = a_find(u->attribs, &at_otherfaction);
|
||||||
|
|
||||||
if(u->faction == f) {
|
if (u->faction == f) {
|
||||||
marker = '*';
|
marker = '*';
|
||||||
} else {
|
} else {
|
||||||
if(a_otherfaction && f != u->faction && get_otherfaction(a_otherfaction) == f
|
if (a_otherfaction && f != u->faction && get_otherfaction(a_otherfaction) == f
|
||||||
&& !fval(u, UFL_PARTEITARNUNG)) {
|
&& !fval(u, UFL_PARTEITARNUNG)) {
|
||||||
marker = '!';
|
marker = '!';
|
||||||
} else {
|
} else {
|
||||||
if(dh && !fval(u, UFL_PARTEITARNUNG)) {
|
if (dh && !fval(u, UFL_PARTEITARNUNG)) {
|
||||||
marker = '+';
|
marker = '+';
|
||||||
} else {
|
} else {
|
||||||
marker = '-';
|
marker = '-';
|
||||||
|
@ -576,10 +577,9 @@ rpunit(FILE * F, const faction * f, const unit * u, int indent, int mode)
|
||||||
|
|
||||||
rparagraph(F, buf, indent, 0, marker);
|
rparagraph(F, buf, indent, 0, marker);
|
||||||
|
|
||||||
if(!isbattle){
|
if (!isbattle) {
|
||||||
print_curses(F, f, u, TYP_UNIT, indent);
|
print_curses(F, f, u, TYP_UNIT, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1658,8 +1658,9 @@ report_building(FILE *F, const region * r, const building * b, const faction * f
|
||||||
|
|
||||||
#ifdef WDW_PYRAMID
|
#ifdef WDW_PYRAMID
|
||||||
|
|
||||||
if (i != '!' && i != '?' && i != '.')
|
if (i != '!' && i != '?' && i != '.') {
|
||||||
scat(", ");
|
scat(", ");
|
||||||
|
}
|
||||||
|
|
||||||
if (b->type == bt_find("pyramid")) {
|
if (b->type == bt_find("pyramid")) {
|
||||||
unit * owner = buildingowner(r, b);
|
unit * owner = buildingowner(r, b);
|
||||||
|
@ -1718,14 +1719,17 @@ report_building(FILE *F, const region * r, const building * b, const faction * f
|
||||||
|
|
||||||
print_curses(F, f, b, TYP_BUILDING, 4);
|
print_curses(F, f, b, TYP_BUILDING, 4);
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next)
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u->building == b && fval(u, UFL_OWNER)) {
|
if (u->building == b) {
|
||||||
|
assert(fval(u, UFL_OWNER) || !"you must call reorder_owners() first!");
|
||||||
rpunit(F, f, u, 6, mode);
|
rpunit(F, f, u, 6, mode);
|
||||||
|
u = u->next;
|
||||||
break;
|
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);
|
rpunit(F, f, u, 6, mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -2964,14 +2964,14 @@ reorder_owners(region * r)
|
||||||
unit ** insert;
|
unit ** insert;
|
||||||
if (fval(u, UFL_OWNER)) {
|
if (fval(u, UFL_OWNER)) {
|
||||||
unit * nu = *ubegin;
|
unit * nu = *ubegin;
|
||||||
insert=ubegin;
|
insert = ubegin;
|
||||||
if (nu!=u && nu->building==u->building && fval(nu, UFL_OWNER)) {
|
if (nu!=u && nu->building==u->building && fval(nu, UFL_OWNER)) {
|
||||||
log_error(("[reorder_owners] %s hat mehrere Besitzer mit UFL_OWNER.\n", buildingname(nu->building)));
|
log_error(("[reorder_owners] %s hat mehrere Besitzer mit UFL_OWNER.\n", buildingname(nu->building)));
|
||||||
freset(nu, UFL_OWNER);
|
freset(nu, UFL_OWNER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else insert = uend;
|
else insert = uend;
|
||||||
if (insert!=useek) {
|
if (insert != useek) {
|
||||||
*useek = u->next; /* raus aus der liste */
|
*useek = u->next; /* raus aus der liste */
|
||||||
u->next = *insert;
|
u->next = *insert;
|
||||||
*insert = u;
|
*insert = u;
|
||||||
|
|
|
@ -303,16 +303,14 @@ racename(const struct locale *loc, const unit *u, const race * rc)
|
||||||
strcpy(lbuf, locale_string(loc, mkname("prefix", prefix)));
|
strcpy(lbuf, locale_string(loc, mkname("prefix", prefix)));
|
||||||
s += strlen(lbuf);
|
s += strlen(lbuf);
|
||||||
if (asyn!=NULL) {
|
if (asyn!=NULL) {
|
||||||
strcpy(s, locale_string(loc,
|
strcpy(s, LOC(loc, ((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
|
||||||
((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
|
|
||||||
} else {
|
} else {
|
||||||
strcpy(s, LOC(loc, rc_name(rc, u->number != 1)));
|
strcpy(s, LOC(loc, rc_name(rc, u->number != 1)));
|
||||||
}
|
}
|
||||||
s[0] = (char)tolower(s[0]);
|
s[0] = (char)tolower(s[0]);
|
||||||
return lbuf;
|
return lbuf;
|
||||||
} else if (asyn!=NULL) {
|
} else if (asyn!=NULL) {
|
||||||
return(locale_string(loc,
|
return(LOC(loc, ((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
|
||||||
((frace_synonyms *)(asyn->data.v))->synonyms[u->number != 1]));
|
|
||||||
}
|
}
|
||||||
return LOC(loc, rc_name(rc, u->number != 1));
|
return LOC(loc, rc_name(rc, u->number != 1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue