forked from github/server
fix neighbor seen_region collection.
This commit is contained in:
parent
42e51a0ec4
commit
7f9e84d68b
1 changed files with 12 additions and 13 deletions
|
@ -1513,7 +1513,10 @@ static region *firstregion(faction * f)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void view_region(region *r, faction *f) {
|
static void cb_view_neighbours(seen_region *sr, void *cbdata) {
|
||||||
|
faction *f = (faction *)cbdata;
|
||||||
|
if (sr->mode > see_neighbour) {
|
||||||
|
region *r = sr->r;
|
||||||
plane *p = rplane(r);
|
plane *p = rplane(r);
|
||||||
void(*view) (struct seen_region **, region *, faction *) = view_default;
|
void(*view) (struct seen_region **, region *, faction *) = view_default;
|
||||||
|
|
||||||
|
@ -1523,6 +1526,7 @@ static void view_region(region *r, faction *f) {
|
||||||
}
|
}
|
||||||
view(f->seen, r, f);
|
view(f->seen, r, f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void prepare_seen(faction *f)
|
void prepare_seen(faction *f)
|
||||||
{
|
{
|
||||||
|
@ -1533,12 +1537,7 @@ void prepare_seen(faction *f)
|
||||||
sr = find_seen(f->seen, r);
|
sr = find_seen(f->seen, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; sr != NULL; sr = sr->next) {
|
seenhash_map(f->seen, cb_view_neighbours, f);
|
||||||
if (sr->mode > see_neighbour) {
|
|
||||||
region *r = sr->r;
|
|
||||||
view_region(r, f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
get_seen_interval(f->seen, &f->first, &f->last);
|
get_seen_interval(f->seen, &f->first, &f->last);
|
||||||
link_seen(f->seen, f->first, f->last);
|
link_seen(f->seen, f->first, f->last);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue