Check ef_type before dereferencing struct empobj

Such manual checking is error prone, but the best we can do right now.
This commit is contained in:
Markus Armbruster 2008-02-25 20:57:33 +01:00
parent 990b39edec
commit 5490782db3
7 changed files with 52 additions and 9 deletions

View file

@ -622,6 +622,9 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
else
emp_insque(&plp->queue, &bombers);
plane_owner = plp->plane.pln_own;
} else {
CANT_REACH();
break;
}
}
if (!QEMPTY(&missiles)) {
@ -1327,6 +1330,8 @@ air_defense(coord x, coord y, natid victim, struct emp_qelem *bomb_list,
next = qp->q_forw;
glp = (struct genlist *)qp;
gp = glp->thing;
if (CANT_HAPPEN(gp->ef_type != EF_PLANE))
break;
dist = mapdist(x, y, gp->x, gp->y);