Comment and white-space cleanup.

This commit is contained in:
Markus Armbruster 2007-11-03 08:57:05 +00:00
parent 5d41e56aee
commit 6110e08772

View file

@ -397,6 +397,7 @@ pln_airbase_ok(struct plnstr *pp, int oneway)
return 0; return 0;
if (pp->pln_ship >= 0) { if (pp->pln_ship >= 0) {
/* ship: needs to be own or allied, efficient */
if (!getship(pp->pln_ship, &ship)) { if (!getship(pp->pln_ship, &ship)) {
CANT_REACH(); CANT_REACH();
return 0; return 0;
@ -415,6 +416,7 @@ pln_airbase_ok(struct plnstr *pp, int oneway)
return 0; return 0;
} else if (pp->pln_land >= 0) { } else if (pp->pln_land >= 0) {
/* land: needs to be own or allied, efficient, not embarked */
if (!getland(pp->pln_land, &land)) { if (!getland(pp->pln_land, &land)) {
CANT_REACH(); CANT_REACH();
return 0; return 0;
@ -435,26 +437,28 @@ pln_airbase_ok(struct plnstr *pp, int oneway)
return 0; return 0;
} else { } else {
/* sector: needs to be own or allied, efficient airfield */
if (!getsect(pp->pln_x, pp->pln_y, &sect)) { if (!getsect(pp->pln_x, pp->pln_y, &sect)) {
CANT_REACH(); CANT_REACH();
return 0; return 0;
} }
/* First, check allied status */
/* Can't fly from non-owned sectors or non-allied sectors */
if (sect.sct_own != pp->pln_own if (sect.sct_own != pp->pln_own
&& getrel(getnatp(sect.sct_own), pp->pln_own) != ALLIED) { && getrel(getnatp(sect.sct_own), pp->pln_own) != ALLIED) {
pr("(note) An ally does not own the sector %s is in\n", pr("(note) An ally does not own the sector %s is in\n",
prplane(pp)); prplane(pp));
return 0; return 0;
} }
/* non-vtol plane */ /* need airfield unless VTOL */
if ((pcp->pl_flags & P_V) == 0) { if ((pcp->pl_flags & P_V) == 0) {
if (sect.sct_type != SCT_AIRPT) { if (sect.sct_type != SCT_AIRPT) {
pr("%s not at airport\n", prplane(pp)); pr("%s not at airport\n", prplane(pp));
return 0; return 0;
} }
if (sect.sct_effic < 40) { if (sect.sct_effic < 40) {
pr("%s is not 40%% efficient, %s can't take off from there.\n", xyas(sect.sct_x, sect.sct_y, pp->pln_own), prplane(pp)); pr("%s is not 40%% efficient, %s can't take off from there.\n",
xyas(sect.sct_x, sect.sct_y, pp->pln_own),
prplane(pp));
return 0; return 0;
} }
if (!oneway && sect.sct_effic < 60) { if (!oneway && sect.sct_effic < 60) {