fix display of alliance status, some English translation hiccups.

This commit is contained in:
Enno Rehling 2014-08-17 00:14:50 +02:00
parent cef068fe9b
commit 8f09ab73d9
3 changed files with 2232 additions and 2192 deletions

View File

@ -6944,34 +6944,24 @@
<text locale="en">none</text>
</string>
<string name="faction_help_one">
<text locale="de">Wir helfen der Partei</text>
<text locale="en">We are helping the faction</text>
<string name="faction_help">
<text locale="de">Wir helfen</text>
<text locale="en">We are helping</text>
</string>
<string name="faction_help_many">
<text locale="de">Wir helfen den Parteien</text>
<text locale="en">We are helping the factions</text>
</string>
<string name="group_help_one">
<text locale="de">hilft der Partei</text>
<text locale="en">is helping the faction</text>
</string>
<string name="group_help_many">
<text locale="de">hilft den Parteien</text>
<text locale="en">is helping the factions</text>
<string name="group_help">
<text locale="de">hilft</text>
<text locale="en">is helping</text>
</string>
<string name="has_moved_one">
<text locale="de">hat die Region durchquert</text>
<text locale="en">has traveled through the region</text>
<text locale="de">hat die Region durchquert.</text>
<text locale="en">passed through the region.</text>
</string>
<string name="has_moved_many">
<text locale="de">haben die Region durchquert</text>
<text locale="en">have traveled through the region</text>
<text locale="de">haben die Region durchquert.</text>
<text locale="en">passed through the region.</text>
</string>
<string name="see_travel">

View File

@ -804,51 +804,49 @@
<arg name="max" type="int"/>
</type>
<text locale="de">"Unterhaltung: max. $int($max) Silber"</text>
<text locale="en">"Entertainment: max. $int($max) silver"</text>
<text locale="en">"entertainment: max. $int($max) silver"</text>
</message>
<message name="nr_stat_morale" section="nr">
<type>
<arg name="morale" type="int"/>
</type>
<text locale="de">"Moral der Bauern: $int($morale)"</text>
<text locale="en">"Peasant morale: $int($morale)"</text>
<text locale="en">"peasant morale: $int($morale)"</text>
</message>
<message name="nr_stat_luxuries" section="nr">
<type>
<arg name="max" type="int"/>
</type>
<text locale="de">"Luxusgüter zum angegebenen Preis: $int($max)"</text>
<text locale="en">"Luxury goods at this price: $int($max)"</text>
<text locale="en">"luxury goods at this price: $int($max)"</text>
</message>
<message name="nr_stat_salary" section="nr">
<type>
<arg name="max" type="int"/>
</type>
<text locale="de">"Lohn für Arbeit: $int($max) Silber"</text>
<text locale="en">"Worker salary: $int($max) silver"</text>
<text locale="en">"worker salary: $int($max) silver"</text>
</message>
<message name="nr_stat_salary_new" section="nr">
<type>
<arg name="max" type="int"/>
</type>
<text locale="de">"Bauerneinnahmen: $int($max) Silber"</text>
<text locale="en">"Peasant wages: $int($max) silver"</text>
<text locale="en">"peasant wages: $int($max) silver"</text>
</message>
<message name="nr_stat_people" section="nr">
<type>
<arg name="max" type="int"/>
</type>
<text locale="de">"Personen: $int($max)"</text>
<text locale="en">"People: $int($max)"</text>
<text locale="fr">"People: $int($max)"</text>
<text locale="en">"people: $int($max)"</text>
</message>
<message name="nr_stat_recruits" section="nr">
<type>
<arg name="max" type="int"/>
</type>
<text locale="de">"Rekruten: max. $int($max) Bauern"</text>
<text locale="en">"Recruits: $int($max) peasants"</text>
<text locale="fr">"Recruits: $int($max) peasants"</text>
<text locale="en">"recruits: $int($max) peasants"</text>
</message>
<message name="nr_score" section="nr">
<type>
@ -857,7 +855,6 @@
</type>
<text locale="de">"Deine Partei hat $int($score) Punkte. Der Durchschnitt für Parteien ähnlichen Alters ist $int($average) Punkte."</text>
<text locale="fr">"Your faction has a score of $int($score). The average score for similar factions is $int($average)."</text>
<text locale="en">"Your faction has a score of $int($score). The average score for similar factions is $int($average)."</text>
</message>
<message name="nr_header_date" section="nr">
<type>

View File

@ -1,7 +1,7 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@ -143,7 +143,8 @@ static void centre(FILE * F, const char *s, bool breaking)
SP = SP->next;
}
freestrlist(T);
} else {
}
else {
rpc(F, ' ', (REPORTWIDTH - strlen(s) + 1) / 2);
fputs(s, F);
putc('\n', F);
@ -152,7 +153,7 @@ static void centre(FILE * F, const char *s, bool breaking)
static void
rparagraph(FILE * F, const char *str, ptrdiff_t indent, int hanging_indent,
char mark)
char mark)
{
static const char *spaces = " ";
size_t length = REPORTWIDTH;
@ -182,9 +183,11 @@ rparagraph(FILE * F, const char *str, ptrdiff_t indent, int hanging_indent,
fputc(mark, F);
fputc(' ', F);
mark = 0;
} else if (begin == str) {
}
else if (begin == str) {
fwrite(spaces, sizeof(char), indent, F);
} else {
}
else {
fwrite(spaces, sizeof(char), indent + hanging_indent, F);
}
while (*end && end <= begin + length - indent) {
@ -215,10 +218,11 @@ static size_t write_spell_modifier(spell * sp, int flag, const char * str, bool
size_t bytes = 0;
if (cont) {
bytes = strlcpy(bufp, ", ", size);
} else {
}
else {
bytes = strlcpy(bufp, " ", size);
}
bytes += strlcpy(bufp+bytes, str, size-bytes);
bytes += strlcpy(bufp + bytes, str, size - bytes);
return bytes;
}
return 0;
@ -249,11 +253,14 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
}
if (sp->sptyp & PRECOMBATSPELL) {
bytes = (int)strlcpy(bufp, LOC(lang, "sptype_precombat"), size);
} else if (sp->sptyp & COMBATSPELL) {
}
else if (sp->sptyp & COMBATSPELL) {
bytes = (int)strlcpy(bufp, LOC(lang, "sptype_combat"), size);
} else if (sp->sptyp & POSTCOMBATSPELL) {
}
else if (sp->sptyp & POSTCOMBATSPELL) {
bytes = (int)strlcpy(bufp, LOC(lang, "sptype_postcombat"), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, LOC(lang, "sptype_normal"), size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -286,7 +293,8 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}
} else {
}
else {
bytes = _snprintf(bufp, size, "%d %s", itemanz, LOC(lang, resourcename(rtype, itemanz != 1)));
if (wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
@ -304,24 +312,24 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
WARN_STATIC_BUFFER();
startp = bufp;
bytes = (int)write_spell_modifier(sp, FARCASTING, LOC(lang, "smod_far"), startp!=bufp, bufp, size);
bytes = (int)write_spell_modifier(sp, FARCASTING, LOC(lang, "smod_far"), startp != bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
bytes = (int)write_spell_modifier(sp, OCEANCASTABLE, LOC(lang, "smod_sea"), startp!=bufp, bufp, size);
bytes = (int)write_spell_modifier(sp, OCEANCASTABLE, LOC(lang, "smod_sea"), startp != bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
bytes = (int)write_spell_modifier(sp, ONSHIPCAST, LOC(lang, "smod_ship"), startp!=bufp, bufp, size);
bytes = (int)write_spell_modifier(sp, ONSHIPCAST, LOC(lang, "smod_ship"), startp != bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_nofamiliar"), startp!=bufp, bufp, size);
bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_nofamiliar"), startp != bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
if (startp==bufp) {
bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_none"), startp!=bufp, bufp, size);
if (startp == bufp) {
bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_none"), startp != bufp, bufp, size);
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
}
@ -336,7 +344,8 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
if (sp->sptyp & ISCOMBATSPELL) {
bytes = (int)strlcpy(bufp, LOC(lang, keyword(K_COMBATSPELL)), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, LOC(lang, keyword(K_CAST)), size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -365,11 +374,11 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
const char *vars;
} starget;
starget targets[] = {
{P_REGION, REGIONSPELL, NULL},
{P_UNIT, UNITSPELL, "par_unit"},
{P_SHIP, SHIPSPELL, "par_ship"},
{P_BUILDING, BUILDINGSPELL, "par_building"},
{0, 0, NULL}
{ P_REGION, REGIONSPELL, NULL },
{ P_UNIT, UNITSPELL, "par_unit" },
{ P_SHIP, SHIPSPELL, "par_ship" },
{ P_BUILDING, BUILDINGSPELL, "par_building" },
{ 0, 0, NULL }
};
starget *targetp;
char cp = *params++;
@ -389,7 +398,8 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
}
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else if (cp == 's') {
}
else if (cp == 's') {
targetp = targets + 2;
locp = LOC(lang, targetp->vars);
bytes = (int)_snprintf(bufp, size, " <%s>", locp);
@ -401,7 +411,8 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
}
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else if (cp == 'r') {
}
else if (cp == 'r') {
bytes = (int)strlcpy(bufp, " <x> <y>", size);
if (*params == '+') {
++params;
@ -411,7 +422,8 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
}
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else if (cp == 'b') {
}
else if (cp == 'b') {
targetp = targets + 3;
locp = LOC(lang, targetp->vars);
bytes = (int)_snprintf(bufp, size, " <%s>", locp);
@ -423,7 +435,8 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
}
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else if (cp == 'k') {
}
else if (cp == 'k') {
if (*params == 'c') {
/* skip over a potential id */
++params;
@ -456,7 +469,8 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
WARN_STATIC_BUFFER();
bytes = (int)_snprintf(bufp, size, " [<%s> ...]", locp);
}
} else {
}
else {
bytes =
(int)_snprintf(bufp, size, " %s", parameters[targetp->param]);
}
@ -469,13 +483,15 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}
} else if (cp == 'i' || cp == 'c') {
}
else if (cp == 'i' || cp == 'c') {
const char *cstr;
assert(syntaxp);
cstr = strchr(syntaxp, ':');
if (!cstr) {
locp = LOC(lang, mkname("spellpar", syntaxp));
} else {
}
else {
char substr[32];
strncpy(substr, syntaxp, cstr - syntaxp);
substr[cstr - syntaxp] = 0;
@ -524,8 +540,7 @@ void sparagraph(strlist ** SP, const char *s, int indent, char mark)
break;
}
i = j + 1;
}
while (s[j]);
} while (s[j]);
for (j = 0; j != indent; j++)
buf[j] = ' ';
@ -549,7 +564,7 @@ void sparagraph(strlist ** SP, const char *s, int indent, char mark)
static void
nr_curses(FILE * F, const faction * viewer, const void *obj, objtype_t typ,
int indent)
int indent)
{
attrib *a = NULL;
int self = 0;
@ -561,14 +576,15 @@ nr_curses(FILE * F, const faction * viewer, const void *obj, objtype_t typ,
* Spezialfälle (besonderes Talent, verursachender Magier usw. werde
* bei jedem curse gesondert behandelt. */
if (typ == TYP_SHIP) {
ship *sh = (ship *) obj;
ship *sh = (ship *)obj;
unit *owner = ship_owner(sh);
a = sh->attribs;
r = sh->region;
if (owner) {
if (owner->faction == viewer) {
self = 2;
} else { /* steht eine person der Partei auf dem Schiff? */
}
else { /* steht eine person der Partei auf dem Schiff? */
unit *u = NULL;
for (u = r->units; u; u = u->next) {
if (u->ship == sh) {
@ -578,15 +594,17 @@ nr_curses(FILE * F, const faction * viewer, const void *obj, objtype_t typ,
}
}
}
} else if (typ == TYP_BUILDING) {
building *b = (building *) obj;
}
else if (typ == TYP_BUILDING) {
building *b = (building *)obj;
unit *owner;
a = b->attribs;
r = b->region;
if ((owner = building_owner(b)) != NULL) {
if (owner->faction == viewer) {
self = 2;
} else { /* steht eine Person der Partei in der Burg? */
}
else { /* steht eine Person der Partei in der Burg? */
unit *u = NULL;
for (u = r->units; u; u = u->next) {
if (u->building == b) {
@ -596,17 +614,20 @@ nr_curses(FILE * F, const faction * viewer, const void *obj, objtype_t typ,
}
}
}
} else if (typ == TYP_UNIT) {
unit *u = (unit *) obj;
}
else if (typ == TYP_UNIT) {
unit *u = (unit *)obj;
a = u->attribs;
r = u->region;
if (u->faction == viewer) {
self = 2;
}
} else if (typ == TYP_REGION) {
r = (region *) obj;
}
else if (typ == TYP_REGION) {
r = (region *)obj;
a = r->attribs;
} else {
}
else {
/* fehler */
}
@ -614,7 +635,7 @@ nr_curses(FILE * F, const faction * viewer, const void *obj, objtype_t typ,
char buf[4096];
if (fval(a->type, ATF_CURSE)) {
curse *c = (curse *) a->data.v;
curse *c = (curse *)a->data.v;
message *msg;
if (c->type->cansee) {
@ -628,8 +649,9 @@ nr_curses(FILE * F, const faction * viewer, const void *obj, objtype_t typ,
rparagraph(F, buf, indent, 2, 0);
msg_release(msg);
}
} else if (a->type == &at_effect && self) {
effect_data *data = (effect_data *) a->data.v;
}
else if (a->type == &at_effect && self) {
effect_data *data = (effect_data *)a->data.v;
if (data->value > 0) {
sprintf(buf, "Auf der Einheit lieg%s %d Wirkung%s %s.",
(data->value == 1 ? "t" : "en"),
@ -650,7 +672,7 @@ static void rps_nowrap(FILE * F, const char *s)
if (!x) return;
while (*x++ == ' ') ;
while (*x++ == ' ');
indent = x - s - 1;
if (*(x - 1) && indent && *x == ' ')
indent += 2;
@ -671,7 +693,7 @@ nr_unit(FILE * F, const faction * f, const unit * u, int indent, int mode)
attrib *a_otherfaction;
char marker;
int dh;
bool isbattle = (bool) (mode == see_battle);
bool isbattle = (bool)(mode == see_battle);
char buf[8192];
if (fval(u_race(u), RCF_INVISIBLE))
@ -686,16 +708,20 @@ nr_unit(FILE * F, const faction * f, const unit * u, int indent, int mode)
if (u->faction == f) {
marker = '*';
} else if ALLIED
}
else if ALLIED
(u->faction, f) {
marker = 'o';
} else if (a_otherfaction && f != u->faction
}
else if (a_otherfaction && f != u->faction
&& get_otherfaction(a_otherfaction) == f && !fval(u, UFL_ANON_FACTION)) {
marker = '!';
} else {
}
else {
if (dh && !fval(u, UFL_ANON_FACTION)) {
marker = '+';
} else {
}
else {
marker = '-';
}
}
@ -708,7 +734,7 @@ nr_unit(FILE * F, const faction * f, const unit * u, int indent, int mode)
static void
rp_messages(FILE * F, message_list * msgs, faction * viewer, int indent,
bool categorized)
bool categorized)
{
nrsection *section;
if (!msgs)
@ -813,7 +839,8 @@ static void prices(FILE * F, const region * r, const faction * f)
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_trade_end"), size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else if (n == 1) {
}
else if (n == 1) {
bytes = (int)strlcpy(bufp, " ", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
@ -823,7 +850,8 @@ static void prices(FILE * F, const region * r, const faction * f)
bytes = (int)strlcpy(bufp, " ", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else {
}
else {
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_trade_next"), size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
@ -922,11 +950,14 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
if (sr->mode == see_travel) {
bytes = _snprintf(bufp, size, " (%s)", LOC(f->locale, "see_travel"));
} else if (sr->mode == see_neighbour) {
}
else if (sr->mode == see_neighbour) {
bytes = _snprintf(bufp, size, " (%s)", LOC(f->locale, "see_neighbour"));
} else if (sr->mode == see_lighthouse) {
}
else if (sr->mode == see_lighthouse) {
bytes = _snprintf(bufp, size, " (%s)", LOC(f->locale, "see_lighthouse"));
} else {
}
else {
bytes = 0;
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -954,12 +985,15 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
if (fval(r, RF_MALLORN)) {
if (trees == 1) {
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_mallorntree"), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_mallorntree_p"), size);
}
} else if (trees == 1) {
}
else if (trees == 1) {
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_tree"), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_tree_p"), size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -968,7 +1002,7 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
}
/* iron & stone */
if (sr->mode == see_unit && f != (faction *) NULL) {
if (sr->mode == see_unit && f != (faction *)NULL) {
resource_report result[MAX_RAWMATERIALS];
int n, numresults = report_resources(sr, result, MAX_RAWMATERIALS, f);
@ -1004,7 +1038,8 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
bytes =
(int)strlcpy(bufp, LOC(f->locale, n == 1 ? "rc_orc" : "rc_orc_p"),
size);
} else {
}
else {
bytes = (int)strlcpy(bufp, " ", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
@ -1080,7 +1115,8 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
bytes = (int)strlcpy(bufp, (char *)a->data.v, size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else {
}
else {
int nrd = 0;
/* Nachbarregionen, die gesehen werden, ermitteln */
@ -1104,7 +1140,8 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_nb_final"), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, LOC(f->locale, "nr_nb_next"), size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -1119,7 +1156,8 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
bytes = _snprintf(bufp, size, trailinto(r2, f->locale), regname);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else {
}
else {
bytes = (int)strlcpy(bufp, " ", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
@ -1132,7 +1170,7 @@ static void describe(FILE * F, const seen_region * sr, faction * f)
/* Spezielle Richtungen */
for (a = a_find(r->attribs, &at_direction); a && a->type == &at_direction;
a = a->next) {
spec_direction *d = (spec_direction *) (a->data.v);
spec_direction *d = (spec_direction *)(a->data.v);
bytes = (int)strlcpy(bufp, " ", size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
@ -1293,7 +1331,8 @@ static void statistics(FILE * F, const region * r, const faction * f)
if (markets_module()) { /* hack */
m =
msg_message("nr_stat_salary_new", "max", wage(r, NULL, NULL, turn + 1));
} else {
}
else {
m = msg_message("nr_stat_salary", "max", wage(r, f, f->race, turn + 1));
}
nr_render(m, f->locale, buf, sizeof(buf), f);
@ -1310,7 +1349,8 @@ static void statistics(FILE * F, const region * r, const faction * f)
if (!markets_module()) {
if (buildingtype_exists(r, bt_find("caravan"), true)) {
m = msg_message("nr_stat_luxuries", "max", (p * 2) / TRADE_FRACTION);
} else {
}
else {
m = msg_message("nr_stat_luxuries", "max", p / TRADE_FRACTION);
}
nr_render(m, f->locale, buf, sizeof(buf), f);
@ -1354,9 +1394,9 @@ static void durchreisende(FILE * F, const region * r, const faction * f)
/* How many are we listing? For grammar. */
for (a = abegin; a && a->type == &at_travelunit; a = a->next) {
unit *u = (unit *) a->data.v;
unit *u = (unit *)a->data.v;
if (r != u->region && (!u->ship || ship_owner(u->ship)==u)) {
if (r != u->region && (!u->ship || ship_owner(u->ship) == u)) {
if (cansee_durchgezogen(f, r, u, 0)) {
++maxtravel;
}
@ -1371,15 +1411,16 @@ static void durchreisende(FILE * F, const region * r, const faction * f)
rnl(F);
for (a = abegin; a && a->type == &at_travelunit; a = a->next) {
unit *u = (unit *) a->data.v;
unit *u = (unit *)a->data.v;
if (r != u->region && (!u->ship || ship_owner(u->ship)==u)) {
if (r != u->region && (!u->ship || ship_owner(u->ship) == u)) {
if (cansee_durchgezogen(f, r, u, 0)) {
++counter;
if (u->ship != NULL) {
if (counter == 1) {
bytes = (int)strlcpy(bufp, "Die ", size);
} else {
}
else {
bytes = (int)strlcpy(bufp, "die ", size);
}
if (wrptr(&bufp, &size, bytes) != 0) {
@ -1387,7 +1428,8 @@ static void durchreisende(FILE * F, const region * r, const faction * f)
break;
}
bytes = (int)strlcpy(bufp, shipname(u->ship), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, unitname(u), size);
}
if (wrptr(&bufp, &size, bytes) != 0) {
@ -1401,7 +1443,8 @@ static void durchreisende(FILE * F, const region * r, const faction * f)
WARN_STATIC_BUFFER();
break;
}
} else if (counter + 1 == maxtravel) {
}
else if (counter + 1 == maxtravel) {
bytes = (int)strlcpy(bufp, LOC(f->locale, "list_and"), size);
if (wrptr(&bufp, &size, bytes) != 0) {
WARN_STATIC_BUFFER();
@ -1412,7 +1455,7 @@ static void durchreisende(FILE * F, const region * r, const faction * f)
}
}
/* TODO: finish localization */
if (size>0) {
if (size > 0) {
if (maxtravel == 1) {
bytes = _snprintf(bufp, size, " %s", LOC(f->locale, "has_moved_one"));
}
@ -1463,7 +1506,7 @@ report_template(const char *filename, report_context * ctx, const char *charset)
char buf[8192], *bufp;
size_t size;
int bytes;
bool utf8 = _strcmpl(charset, "utf8")==0 || _strcmpl(charset, "utf-8")==0;
bool utf8 = _strcmpl(charset, "utf8") == 0 || _strcmpl(charset, "utf-8") == 0;
if (F == NULL) {
perror(filename);
@ -1521,7 +1564,8 @@ report_template(const char *filename, report_context * ctx, const char *charset)
if (pl && pl->id != 0) {
sprintf(buf, "%s %d,%d,%d ; %s", LOC(f->locale,
parameters[P_REGION]), nx, ny, pl->id, rname(r, f->locale));
} else {
}
else {
sprintf(buf, "%s %d,%d ; %s", LOC(f->locale, parameters[P_REGION]),
nx, ny, rname(r, f->locale));
}
@ -1542,7 +1586,7 @@ report_template(const char *filename, report_context * ctx, const char *charset)
unitid(u), u->name, u->number, get_money(u));
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
if (u->building && building_owner(u->building)==u) {
if (u->building && building_owner(u->building) == u) {
building *b = u->building;
int cost = buildingmaintenance(b, rsilver);
@ -1554,10 +1598,12 @@ report_template(const char *filename, report_context * ctx, const char *charset)
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}
} else if (u->ship) {
if (ship_owner(u->ship)==u) {
}
else if (u->ship) {
if (ship_owner(u->ship) == u) {
bytes = (int)strlcpy(bufp, ",S", size);
} else {
}
else {
bytes = (int)strlcpy(bufp, ",s", size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -1636,7 +1682,8 @@ show_allies(const faction * f, const ally * allies, char *buf, size_t size)
if (dh) {
if (i == allierte) {
bytes = (int)strlcpy(bufp, LOC(f->locale, "list_and"), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, ", ", size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -1654,7 +1701,8 @@ show_allies(const faction * f, const ally * allies, char *buf, size_t size)
bytes = (int)strlcpy(bufp, locale_string(f->locale, parameters[P_ANY]), size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
} else {
}
else {
for (h = 1; h < HELP_ALL; h *= 2) {
int p = MAXPARAMS;
if ((mode & h) == h) {
@ -1685,7 +1733,7 @@ show_allies(const faction * f, const ally * allies, char *buf, size_t size)
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
}
bytes = (int)strlcpy(bufp, parameters[p], size);
bytes = (int)strlcpy(bufp, locale_string(f->locale, parameters[p]), size);
if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER();
hh = 1;
@ -1710,11 +1758,7 @@ static void allies(FILE * F, const faction * f)
if (f->allies) {
int bytes;
size_t size = sizeof(buf);
if (!f->allies->next) {
bytes = _snprintf(buf, size, "%s ", LOC(f->locale, "faction_help_one"));
} else {
bytes = _snprintf(buf, size, "%s ", LOC(f->locale, "faction_help_many"));
}
bytes = _snprintf(buf, size, "%s ", LOC(f->locale, "faction_help"));
size -= bytes;
show_allies(f, f->allies, buf + bytes, size);
rparagraph(F, buf, 0, 0, 0);
@ -1725,11 +1769,7 @@ static void allies(FILE * F, const faction * f)
if (g->allies) {
int bytes;
size_t size = sizeof(buf);
if (!g->allies->next) {
bytes = _snprintf(buf, size, "%s %s ", g->name, LOC(f->locale, "group_help_one"));
} else {
bytes = _snprintf(buf, size, "%s %s ", g->name, LOC(f->locale, "group_help_many"));
}
bytes = _snprintf(buf, size, "%s %s ", g->name, LOC(f->locale, "group_help"));
size -= bytes;
show_allies(f, g->allies, buf + bytes, size);
rparagraph(F, buf, 0, 0, 0);
@ -1765,7 +1805,8 @@ static void guards(FILE * F, const region * r, const faction * see)
if (f != see && fval(u, UFL_ANON_FACTION)) {
tarned = true;
} else {
}
else {
for (i = 0; i != nextguard; ++i)
if (guardians[i] == f)
break;
@ -1790,7 +1831,8 @@ static void guards(FILE * F, const region * r, const faction * see)
if (i != 0) {
if (i == nextguard - (tarned ? 0 : 1)) {
bytes = (int)strlcpy(bufp, LOC(see->locale, "list_and"), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, ", ", size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -1798,7 +1840,8 @@ static void guards(FILE * F, const region * r, const faction * see)
}
if (i < nextguard) {
bytes = (int)strlcpy(bufp, factionname(guardians[i]), size);
} else {
}
else {
bytes = (int)strlcpy(bufp, "unbekannten Einheiten", size);
}
if (wrptr(&bufp, &size, bytes) != 0)
@ -1856,7 +1899,7 @@ static void list_address(FILE * F, const faction * uf, quicklist * seenfactions)
static void
nr_ship(FILE * F, const seen_region * sr, const ship * sh, const faction * f,
const unit * captain)
const unit * captain)
{
const region *r = sr->r;
char buffer[8192], *bufp = buffer;
@ -1873,7 +1916,8 @@ nr_ship(FILE * F, const seen_region * sr, const ship * sh, const faction * f,
bytes = _snprintf(bufp, size, "%s, %s, (%d/%d)", shipname(sh),
LOC(f->locale, sh->type->_name), n, shipcapacity(sh) / 100);
} else {
}
else {
bytes =
_snprintf(bufp, size, "%s, %s", shipname(sh), LOC(f->locale,
sh->type->_name));
@ -1930,7 +1974,7 @@ nr_ship(FILE * F, const seen_region * sr, const ship * sh, const faction * f,
static void
nr_building(FILE * F, const seen_region * sr, const building * b,
const faction * f)
const faction * f)
{
int i, bytes;
const char *name, *bname, *billusion = NULL;
@ -2078,7 +2122,7 @@ static void nr_paragraph(FILE * F, message * m, faction * f)
int
report_plaintext(const char *filename, report_context * ctx,
const char *charset)
const char *charset)
{
int flag = 0;
char ch;
@ -2096,7 +2140,7 @@ report_plaintext(const char *filename, report_context * ctx,
seen_region *sr = NULL;
char buf[8192];
char *bufp;
bool utf8 = _strcmpl(charset, "utf8")==0 || _strcmpl(charset, "utf-8")==0;
bool utf8 = _strcmpl(charset, "utf8") == 0 || _strcmpl(charset, "utf-8") == 0;
size_t size;
/* static variables can cope with writing for different turns */
@ -2245,7 +2289,8 @@ report_plaintext(const char *filename, report_context * ctx,
if (thisseason == 0) {
centre(F, LOC(f->locale, "nr_insectwinter"), true);
rnl(F);
} else {
}
else {
if (nextseason == 0) {
centre(F, LOC(f->locale, "nr_insectfall"), true);
rnl(F);
@ -2283,7 +2328,7 @@ report_plaintext(const char *filename, report_context * ctx,
rnl(F);
centre(F, LOC(f->locale, "section_newspells"), true);
while (a && a->type == &at_reportspell) {
spellbook_entry *sbe = (spellbook_entry *) a->data.v;
spellbook_entry *sbe = (spellbook_entry *)a->data.v;
nr_spell(F, sbe, f->locale);
a = a->next;
}
@ -2374,7 +2419,8 @@ report_plaintext(const char *filename, report_context * ctx,
if (herb && lux) {
m = msg_message("nr_market_info_p", "p1 p2",
lux ? lux->rtype : 0, herb ? herb->rtype : 0);
} else if (lux || herb) {
}
else if (lux || herb) {
m = msg_message("nr_market_info_s", "p1",
lux ? lux->rtype : herb->rtype);
}
@ -2383,7 +2429,8 @@ report_plaintext(const char *filename, report_context * ctx,
nr_paragraph(F, m, f);
}
/* */
} else {
}
else {
if (!fval(r->terrain, SEA_REGION) && rpeasants(r) / TRADE_FRACTION > 0) {
rnl(F);
prices(F, r, f);
@ -2391,15 +2438,18 @@ report_plaintext(const char *filename, report_context * ctx,
}
guards(F, r, f);
durchreisende(F, r, f);
} else {
}
else {
if (sr->mode == see_far) {
describe(F, sr, f);
guards(F, r, f);
durchreisende(F, r, f);
} else if (sr->mode == see_lighthouse) {
}
else if (sr->mode == see_lighthouse) {
describe(F, sr, f);
durchreisende(F, r, f);
} else {
}
else {
describe(F, sr, f);
durchreisende(F, r, f);
}
@ -2467,7 +2517,8 @@ report_plaintext(const char *filename, report_context * ctx,
if (!anyunits) {
rnl(F);
rparagraph(F, LOC(f->locale, "nr_youaredead"), 0, 2, 0);
} else {
}
else {
list_address(F, f, ctx->addresses);
}
}
@ -2544,7 +2595,8 @@ static void add_find(faction * f, unit * u, faction * f2)
if (!*fp) {
fs = *fp = calloc(sizeof(struct fsee), 1);
fs->f = f;
} else
}
else
fs = *fp;
sp = &fs->see;
while (*sp && (*sp)->seen != f2)
@ -2553,7 +2605,8 @@ static void add_find(faction * f, unit * u, faction * f2)
ss = *sp = calloc(sizeof(struct see), 1);
ss->proof = u;
ss->seen = f2;
} else
}
else
ss = *sp;
ss->proof = u;
}
@ -2586,7 +2639,7 @@ static void update_find(void)
bool kann_finden(faction * f1, faction * f2)
{
update_find();
return (bool) (can_find(f1, f2) != NULL);
return (bool)(can_find(f1, f2) != NULL);
}
/******* end summary ******/