bomb, drop, fly, paradrop, recon and sweep fail when given a
destination sector equal to the assembly point. Broken in commit
404a76f7, v4.3.27. Reported by Tom Johnson.
Before that commit, getpath() returned NULL on error, "" when input is
an empty path, "h" when it's coordinates of the assembly point, and a
non-empty path otherwise.
The commit accidentally changed it to return "" instead of "h".
Instead of changing it back, make it return NULL when input is an
empty path, and change bomb() & friends to accept empty flight paths.
This also affects sail: it now fails when you give it an empty path,
just like bomb & friends. Path "h" still works.
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, MOB_FLY)
- || *flightpath == 0)
+ if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, MOB_FLY))
return RET_SYN;
tx = ax;
ty = ay;
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
- || *flightpath == 0)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY))
return RET_SYN;
tx = ax;
ty = ay;
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
- || *flightpath == 0)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY))
return RET_SYN;
tx = ax;
ty = ay;
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
- || *flightpath == 0)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY))
return RET_SYN;
tx = ax;
ty = ay;
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY)
- || *flightpath == 0)
+ if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, MOB_FLY))
return RET_SYN;
tx = ax;
ty = ay;
break;
}
if (dir == DIR_STOP) {
- p[1] = 0;
+ *p = 0;
return buf;
}
++p;
strcpy(p, bp);
if (*bp)
goto more;
- return buf;
+ return buf[0] ? buf : NULL;
}
/*