From 84bc6c58a83b393f6c6d170f8aaa3217fdbfad5d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 12 Sep 2016 15:59:22 +0200 Subject: [PATCH] prepare_reports gone prepare_seen is something else now unit tests are crashing --- src/reports.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/reports.c b/src/reports.c index 06408d96e..07657e757 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1367,17 +1367,14 @@ static void cb_add_seen(region *r, unit *u, void *cbdata) { } } -static void prepare_reports(void) +void prepare_seen(faction *f) { region *r; - faction *f; building *b; const struct building_type *bt_lighthouse = bt_find("lighthouse"); - for (f = factions; f; f = f->next) { - if (f->seen) seen_done(f->seen); - f->seen = seen_init(); - } + if (f->seen) seen_done(f->seen); + f->seen = seen_init(); for (r = regions; r; r = r->next) { unit *u; @@ -1498,20 +1495,6 @@ static void cb_view_neighbours(seen_region *sr, void *cbdata) { } } -void prepare_seen(faction *f) -{ - region *r; - struct seen_region *sr; - - for (r = f->first, sr = NULL; sr == NULL && r != f->last; r = r->next) { - sr = find_seen(f->seen, r); - } - - seenhash_map(f->seen, cb_view_neighbours, f); - get_seen_interval(f->seen, &f->first, &f->last); - link_seen(f->seen, f->first, f->last); -} - static void prepare_report(struct report_context *ctx, faction *f) { prepare_seen(f); @@ -1609,7 +1592,6 @@ int init_reports(void) { check_messages_exist(); create_directories(); - prepare_reports(); return 0; }