Fix flying commands for destination equal to assembly point

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.
This commit is contained in:
Markus Armbruster 2012-08-11 16:46:25 +02:00
parent 9645a73bfb
commit 0f1e14f0f3
6 changed files with 7 additions and 12 deletions

View file

@ -108,8 +108,7 @@ bomb(void)
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;