ESCORT MISSIONS (planes only)
.s1
When given an escort mission, an escort or intercept capable plane will attempt
-to escort any plane flying a support or interdict mission from the same airport.
+to escort any plane flying a support or interdict mission from the
+same airport into its op-area.
If even 1 plane flies a support or interdiction mission from an airport, all
planes on escort duty at that airport will attempt to escort. Planes with escort
duty will NOT attempt to escort planes taking off from other airports, so it
return RET_FAIL;
}
- if (mission && mission != MI_ESCORT) {
+ if (mission) {
if ((p = getstarg(player->argp[4], "operations point? ", buf)) == 0
|| *p == 0)
return RET_SYN;
radius = 999;
if (mission == MI_INTERDICT || mission == MI_SUPPORT ||
mission == MI_OSUPPORT || mission == MI_DSUPPORT ||
- mission == MI_RESERVE ||
+ mission == MI_RESERVE || mission == MI_ESCORT ||
mission == MI_AIR_DEFENSE) {
radius = oprange(gp, mission);
if (radius < dist) {
if (mission == MI_INTERDICT || mission == MI_SUPPORT ||
mission == MI_OSUPPORT || mission == MI_DSUPPORT ||
- mission == MI_RESERVE ||
+ mission == MI_RESERVE || mission == MI_ESCORT ||
mission == MI_AIR_DEFENSE)
gp->radius = radius;
else
if (mission == MI_SUPPORT || mission == MI_OSUPPORT ||
mission == MI_DSUPPORT || mission == MI_INTERDICT ||
- mission == MI_RESERVE ||
+ mission == MI_RESERVE || mission == MI_ESCORT ||
mission == MI_AIR_DEFENSE) {
pr("%s on %s mission, centered on %s, radius %d\n",
obj_nameof(gp), mission_name(mission),
struct nstr_item ni;
struct plist *plp;
struct plnstr plane;
- int dist;
snxtitem_all(&ni, EF_PLANE);
while (nxtitem(&ni, &plane)) {
if (plane.pln_own != cn)
continue;
-
if (plane.pln_mission != MI_ESCORT)
continue;
-
- dist = mapdist(x, y, plane.pln_x, plane.pln_y);
- if (dist > plane.pln_range / 2)
+ if (!in_oparea((struct empobj *)&plane, x, y))
continue;
-
plp = malloc(sizeof(struct plist));
memset(plp, 0, sizeof(struct plist));
plp->pcp = &plchr[(int)plane.pln_type];
case MI_INTERDICT:
case MI_SUPPORT:
case MI_RESERVE:
+ case MI_ESCORT:
case MI_AIR_DEFENSE:
case MI_DSUPPORT:
case MI_OSUPPORT:
prxy(" %3d,%-3d", gp->opx, gp->opy, player->cnum);
pr(" %4d", gp->radius);
break;
- case MI_ESCORT:
- pr(" ");
- pr(" %4d", item.plane.pln_range / 2);
- break;
default:
CANT_REACH();
/* fall through */