if (pp->pln_ship >= 0) {
if (!getship(pp->pln_ship, &ship)) {
- shipsunk:
- pp->pln_effic = 0;
- putplane(pp->pln_uid, pp);
+ CANT_REACH();
return 0;
}
- if (!could_be_on_ship(pp, &ship)) {
- goto shipsunk;
- }
- if (ship.shp_effic < SHIP_MINEFF) {
- goto shipsunk;
- }
+ if (CANT_HAPPEN(ship.shp_effic < SHIP_MINEFF
+ || !could_be_on_ship(pp, &ship)))
+ return 0;
+
/* Can't fly off of inefficient or non-owned, non-allied ships */
if ((ship.shp_effic < SHP_AIROPS_EFF) ||
((ship.shp_own != pp->pln_own) &&
} else if (pp->pln_land >= 0) {
if (!getland(pp->pln_land, &land)) {
- landdead:
- pp->pln_effic = 0;
- putplane(pp->pln_uid, pp);
+ CANT_REACH();
return 0;
}
- if (!(pcp->pl_flags & P_E))
- goto landdead;
- if (land.lnd_effic < LAND_MINEFF)
- goto landdead;
+ if (CANT_HAPPEN(land.lnd_effic < LAND_MINEFF
+ || !(pcp->pl_flags & P_E)))
+ return 0;
/* Can't fly off of inefficient or non-owned, non-allied units */
if ((land.lnd_effic < LND_AIROPS_EFF) ||
}
} else {
- /* If we can't get the sector, we can't check it, and can't fly */
if (!getsect(pp->pln_x, pp->pln_y, §)) {
+ CANT_REACH();
return 0;
}
/* First, check allied status */
struct sctstr sect;
struct plchrstr *pcp = plchr + pp->pln_type;
+ if (CANT_HAPPEN(pp->pln_own != player->cnum))
+ return 0;
+
if (pp->pln_ship >= 0) {
- if (!getship(pp->pln_ship, &ship) ||
- pp->pln_own != player->cnum) {
- shipsunk:
- pp->pln_effic = 0;
- pr("(note) ship not valid for %s\n", prplane(pp));
- putplane(pp->pln_uid, pp);
+ if (!getship(pp->pln_ship, &ship)) {
+ CANT_REACH();
return 0;
}
- if (!could_be_on_ship(pp, &ship))
- goto shipsunk;
- if (ship.shp_effic < SHIP_MINEFF)
- goto shipsunk;
+ if (CANT_HAPPEN(ship.shp_effic < SHIP_MINEFF
+ || !could_be_on_ship(pp, &ship)))
+ return 0;
+
if (ship.shp_effic < SHP_AIROPS_EFF)
return 0;
/* Can't fly off non-owned ships or non-allied ship */
}
} else if (pp->pln_land >= 0) {
- if (!getland(pp->pln_land, &land) ||
- (pp->pln_own != player->cnum)) {
- landdead:
- pp->pln_effic = 0;
- pr("(note) land unit not valid for %s\n", prplane(pp));
- putplane(pp->pln_uid, pp);
+ if (!getland(pp->pln_land, &land)) {
+ CANT_REACH();
return 0;
}
- if (!(plchr[(int)pp->pln_type].pl_flags & P_E))
- goto landdead;
- if (land.lnd_effic < LAND_MINEFF)
- goto landdead;
+ if (CANT_HAPPEN(land.lnd_effic < LAND_MINEFF
+ || !(pcp->pl_flags & P_E)))
+ return 0;
+
if (land.lnd_effic < LND_AIROPS_EFF)
return 0;
/* Can't fly off units in ships or other units */
}
} else {
- if (!getsect(pp->pln_x, pp->pln_y, §))
+ if (!getsect(pp->pln_x, pp->pln_y, §)) {
+ CANT_REACH();
return 0;
+ }
/* First, check allied status */
/* Can't fly from non-owned sectors or non-allied sectors */
if ((sect.sct_own != player->cnum) &&