if (!mapindex)
return NULL;
- bpath[0] = 0;
if (0 != (restr2 = (*terrain == 'R')))
terrain++;
ex = XNORM(ex);
ey = YNORM(ey);
- if (x == ex && y == ey) {
- bpath[0] = 'h';
- bpath[1] = 0;
- return bpath;
- }
+ if (x == ex && y == ey)
+ return "h";
if (!valid(x, y) || !valid(ex, ey))
return NULL;
maxy = y + 1;
do {
- if (++routelen == MAXROUTE) {
- bpath[0] = '?';
- bpath[1] = 0;
- return bpath;
- }
+ if (++routelen == MAXROUTE)
+ return "?";
markedsectors = 0;
for (scanx = minx; scanx <= maxx; scanx++) {
x = XNORM(scanx);
maxx += 2;
} while (markedsectors);
- bpath[0] = 0;
return NULL; /* no route possible */
}
for (qp = airp.q_forw; qp != (&airp); qp = qp->q_forw) {
struct airport *air;
- s_char pp[512];
+ char buf[512];
+ char *pp;
air = (struct airport *)qp;
md = mapdist(x, y, air->x, air->y);
mission_flags = mission_pln_arm(&b, air->x, air->y, 2 * md, 'p', 0,
0, mission_flags, &tech);
- if (QEMPTY(&b)) {
+ if (QEMPTY(&b))
continue;
- }
mission_flags = mission_pln_arm(&e, air->x, air->y, 2 * md, 'p', 0,
P_F | P_ESC, mission_flags, &tech);
- BestAirPath(pp, air->x, air->y, x, y);
+ pp = BestAirPath(buf, air->x, air->y, x, y);
+ if (CANT_HAPPEN(!pp))
+ continue;
wu(0, plane_owner, "Flying %s mission from %s\n",
mission_name(mission), xyas(air->x, air->y, plane_owner));
if (air->own && (air->own != plane_owner)) {
struct genlist *glp;
struct genitem *gp;
struct genlist mi[MAXNOC];
- s_char path[512];
+ char buf[512];
+ char *path;
int count;
int tcount;
continue;
}
- BestAirPath(path, air->x, air->y, x, y);
+ path = BestAirPath(buf, air->x, air->y, x, y);
+ if (CANT_HAPPEN(!path))
+ continue;
wu(0, cn, "Flying %s mission from %s\n",
mission_name(MI_AIR_DEFENSE), xyas(air->x, air->y, cn));
if (air->own && (air->own != cn)) {