diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 7ace358ae..310986530 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -2913,6 +2913,8 @@ reports(void) report_donations(); remove_empty_units(); + log_printf("Updating region intervals\n"); + update_intervals(); log_printf("Report timestamp - %s\n", pzTime); for (f = factions; f; f = f->next) { faction_list * addresses; diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 3ae6abf61..84ac3e9cf 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -1947,20 +1947,24 @@ update_intervals(void) for (u = r->units; u; u = u->next) { faction * f = u->faction; if (f->first==NULL) f->first = r; + f->last = r->next; } for (ru = a_find(r->attribs, &at_travelunit); ru; ru = ru->nexttype) { faction * f = ((unit*)ru->data.v)->faction; if (f->first==NULL) f->first = r; + f->last = r->next; } ulist = get_lighthouses(r); for (uptr=ulist;uptr!=NULL;uptr=uptr->next) { /* check lighthouse warden's faction */ unit * u = uptr->data; - if (u->faction->first==NULL) { - u->faction->first = r; + faction * f = u->faction; + if (f->first==NULL) { + f->first = r; } + f->last = r->next; } unitlist_clear(&ulist); @@ -1969,6 +1973,7 @@ update_intervals(void) while (w) { faction * f = w->faction; if (f->first==NULL) f->first = r; + f->last = r->next; w = w->next; } } diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index b7dfb01b5..e9660f862 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -1053,8 +1053,10 @@ int change_hitpoints(struct unit *u, int value); int weight(const struct unit * u); void changeblockchaos(void); -struct region *firstregion(struct faction * f); -struct region *lastregion(struct faction * f); +/* intervall, in dem die regionen der partei zu finden sind */ +extern void update_intervals(void); +extern struct region *firstregion(struct faction * f); +extern struct region *lastregion(struct faction * f); void inituhash(void); void uhash(struct unit * u);