From 6110e08772a19e9ba991521ae715a8e0650050b9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 3 Nov 2007 08:57:05 +0000 Subject: [PATCH] Comment and white-space cleanup. --- src/lib/subs/plnsub.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index c042decb..d81e34aa 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -397,6 +397,7 @@ pln_airbase_ok(struct plnstr *pp, int oneway) return 0; if (pp->pln_ship >= 0) { + /* ship: needs to be own or allied, efficient */ if (!getship(pp->pln_ship, &ship)) { CANT_REACH(); return 0; @@ -415,6 +416,7 @@ pln_airbase_ok(struct plnstr *pp, int oneway) return 0; } else if (pp->pln_land >= 0) { + /* land: needs to be own or allied, efficient, not embarked */ if (!getland(pp->pln_land, &land)) { CANT_REACH(); return 0; @@ -435,26 +437,28 @@ pln_airbase_ok(struct plnstr *pp, int oneway) return 0; } else { + /* sector: needs to be own or allied, efficient airfield */ 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 != pp->pln_own && getrel(getnatp(sect.sct_own), pp->pln_own) != ALLIED) { pr("(note) An ally does not own the sector %s is in\n", prplane(pp)); return 0; } - /* non-vtol plane */ + /* need airfield unless VTOL */ if ((pcp->pl_flags & P_V) == 0) { if (sect.sct_type != SCT_AIRPT) { pr("%s not at airport\n", prplane(pp)); return 0; } 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; } if (!oneway && sect.sct_effic < 60) {