forked from github/server
Valenar crash: bad report interval when a faction has no units.
This commit is contained in:
parent
1e78414562
commit
7790ebd671
|
@ -1367,6 +1367,9 @@ void reorder_units(region * r)
|
||||||
|
|
||||||
static region *lastregion(faction * f)
|
static region *lastregion(faction * f)
|
||||||
{
|
{
|
||||||
|
if (!f->units) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return f->last ? f->last->next : NULL;
|
return f->last ? f->last->next : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1418,6 +1421,7 @@ void prepare_report(report_context *ctx, faction *f)
|
||||||
ctx->addresses = NULL;
|
ctx->addresses = NULL;
|
||||||
ctx->userdata = NULL;
|
ctx->userdata = NULL;
|
||||||
/* [first,last) interval of regions with a unit in it: */
|
/* [first,last) interval of regions with a unit in it: */
|
||||||
|
if (f->units) {
|
||||||
ctx->first = firstregion(f);
|
ctx->first = firstregion(f);
|
||||||
ctx->last = lastregion(f);
|
ctx->last = lastregion(f);
|
||||||
|
|
||||||
|
@ -1457,6 +1461,7 @@ void prepare_report(report_context *ctx, faction *f)
|
||||||
travelthru_map(r, cb_add_seen, f);
|
travelthru_map(r, cb_add_seen, f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* [fast,last) interval of seen regions (with lighthouses and travel)
|
/* [fast,last) interval of seen regions (with lighthouses and travel)
|
||||||
* TODO: what about neighbours? when are they included? do we need
|
* TODO: what about neighbours? when are they included? do we need
|
||||||
* them outside of the CR? */
|
* them outside of the CR? */
|
||||||
|
|
Loading…
Reference in New Issue