Fix cargo list shutdown oops
EF_PLANE is closed before EF_LAND: if a land unit carries a plane, the plane goes away before its carrier, and unit_onresize() oopses. Fix by not checking cargo list consistency there when the file is already gone. unit_cargo_init() has a similar issue, at least theoretically: it rebuilds cargo lists one after the other. Zap them all first.
This commit is contained in:
parent
1876932cd9
commit
c34daec8c6
1 changed files with 4 additions and 4 deletions
|
@ -235,10 +235,9 @@ unit_cargo_init(void)
|
||||||
struct lndstr *lp;
|
struct lndstr *lp;
|
||||||
struct nukstr *np;
|
struct nukstr *np;
|
||||||
|
|
||||||
for (i = EF_SHIP; i <= EF_NUKE; i++) {
|
memset(nclink, 0, sizeof(nclink));
|
||||||
nclink[i] = 0;
|
for (i = EF_SHIP; i <= EF_NUKE; i++)
|
||||||
unit_onresize(i);
|
unit_onresize(i);
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; (pp = getplanep(i)); i++) {
|
for (i = 0; (pp = getplanep(i)); i++) {
|
||||||
if (!pp->pln_own)
|
if (!pp->pln_own)
|
||||||
|
@ -285,6 +284,7 @@ unit_onresize(int type)
|
||||||
clink_init(&cl[i]);
|
clink_init(&cl[i]);
|
||||||
clink[type] = cl;
|
clink[type] = cl;
|
||||||
nclink[type] = n;
|
nclink[type] = n;
|
||||||
|
if (ef_flags(type) & EFF_MEM)
|
||||||
clink_check(type);
|
clink_check(type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue