diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index 0d33eec38..db9a0aabd 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -1083,7 +1083,7 @@ get_seen_interval(region ** first, region ** last) } /* main function of the creport. creates the header and traverses all regions */ -void +int report_computer(FILE * F, faction * f, const faction_list * addresses, const time_t report_time) { @@ -1525,4 +1525,5 @@ report_computer(FILE * F, faction * f, const faction_list * addresses, report_crtypes(F, f->locale); write_translations(F); reset_translations(); + return 0; } diff --git a/src/common/gamecode/creport.h b/src/common/gamecode/creport.h index 02629b254..66b8be1eb 100644 --- a/src/common/gamecode/creport.h +++ b/src/common/gamecode/creport.h @@ -20,7 +20,7 @@ extern "C" { struct faction_list; struct seen_region; struct faction; -extern void report_computer(FILE * F, struct faction * f, +extern int report_computer(FILE * F, struct faction * f, const struct faction_list * addresses, const time_t report_time); extern void creport_cleanup(void); extern void creport_init(void); diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 91728b4ca..12e7456ef 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -1575,7 +1575,7 @@ buildingmaintenance(const building * b, const resource_type * rtype) return cost; } -static void +static int order_template(FILE * F, faction * f) { region *r; @@ -1690,6 +1690,7 @@ order_template(FILE * F, faction * f) sprintf(buf, LOC(f->locale, parameters[P_NEXT])); rps_nowrap(F, buf); rnl(F); + return 0; } static void @@ -1978,7 +1979,7 @@ report_building(FILE *F, const region * r, const building * b, const faction * f rpunit(F, f, u, 6, mode); } -static void +static int report(FILE *F, faction * f, const faction_list * addresses, const char * pzTime) { @@ -2408,6 +2409,7 @@ report(FILE *F, faction * f, const faction_list * addresses, list_address(F, f, addresses); } } + return 0; } FILE * @@ -2685,7 +2687,7 @@ struct fsee { } * see; } * fsee[FMAXHASH]; -void +int reports(void) { faction *f; @@ -2741,9 +2743,10 @@ reports(void) sprintf(buf, "%s/%d-%s.nr", reportpath(), turn, factionid(f)); F = cfopen(buf, "wt"); if (F) { - report(F, f, addresses, pzTime); + int status = report(F, f, addresses, pzTime); fclose(F); gotit = true; + if (status!=0) return status; /* catch errors */ } } /* CR schreiben: */ @@ -2751,9 +2754,10 @@ reports(void) sprintf(buf, "%s/%d-%s.cr", reportpath(), turn, factionid(f)); F = cfopen(buf, "wt"); if (F) { - report_computer(F, f, addresses, ltime); + int status = report_computer(F, f, addresses, ltime); fclose(F); gotit = true; + if (status!=0) return status; /* catch errors */ } } /* ZV schreiben: */ @@ -2761,8 +2765,9 @@ reports(void) sprintf(buf, "%s/%d-%s.txt", reportpath(), turn, factionid(f)); F = cfopen(buf, "wt"); if (F) { - order_template(F, f); + int status = order_template(F, f); fclose(F); + if (status!=0) return status; /* catch errors */ } } if (f->no > 0 && f->email && BAT) { @@ -2895,6 +2900,7 @@ reports(void) closebatch(BAT); current_faction = NULL; seen_done(); + return 0; } void @@ -3024,7 +3030,7 @@ typedef struct summary { } summary; summary * -make_summary(boolean count_new) +make_summary(void) { faction *f; region *r; @@ -3045,8 +3051,14 @@ make_summary(boolean count_new) f->nregions = 0; f->num_total = 0; f->money = 0; - if (f->alive && (count_new || f->age > 0)) s->factions++; - } + if (f->alive && f->units) { + s->factions++; + /* Problem mit Monsterpartei ... */ + if (f->no!=MONSTER_FACTION) { + s->factionrace[old_race(f->race)]++; + } + } + } /* Alles zählen */ @@ -3142,13 +3154,6 @@ make_summary(boolean count_new) } } - /* jetzt noch parteienweise zählen */ - /* Problem mit Monsterpartei ... */ - for (f = factions; f; f = f->next) if (f->no!=MONSTER_FACTION) { - if (f->alive && (count_new || f->age > 0)) { - s->factionrace[old_race(f->race)]++; - } - } return s; } diff --git a/src/common/kernel/reports.h b/src/common/kernel/reports.h index 22c8f09ba..8ede16de5 100644 --- a/src/common/kernel/reports.h +++ b/src/common/kernel/reports.h @@ -46,13 +46,13 @@ const char *hp_status(const struct unit * u); extern void spskill(const struct locale * lang, const struct unit * u, skill_t sk, int *dh, int days); /* mapper */ extern void spunit(struct strlist ** SP, const struct faction * f, const struct unit * u, int indent, int mode); -void reports(void); +int reports(void); extern const struct unit *ucansee(const struct faction *f, const struct unit *u, const struct unit *x); struct summary; extern void report_summary(struct summary * n, struct summary * o, boolean full); -extern struct summary * make_summary(boolean count_new); +extern struct summary * make_summary(); int hat_in_region(item_t itm, struct region * r, struct faction * f); diff --git a/src/eressea/main.c b/src/eressea/main.c index a43d5ed1b..f33168875 100644 --- a/src/eressea/main.c +++ b/src/eressea/main.c @@ -285,7 +285,7 @@ processturn(char *filename) #ifdef SHORTPWDS readshortpwds("passwords"); #endif - begin = make_summary(false); + begin = make_summary(); printf(" - Korrekturen Runde %d\n", turn); korrektur(); turn++; @@ -310,7 +310,7 @@ processturn(char *filename) free_units(); puts(" - Beseitige leere Parteien"); remove_empty_factions(true); - end = make_summary(true); + end = make_summary(); report_summary(end, begin, false); report_summary(end, begin, true); free(end); diff --git a/src/res/buildings.xml b/src/res/buildings.xml index 18ec8b127..500e09dfa 100644 --- a/src/res/buildings.xml +++ b/src/res/buildings.xml @@ -1,24 +1,24 @@ - - - - - - + + + + + + - + - + @@ -27,7 +27,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -140,7 +140,7 @@ - +