(get_assembly_point): New.

(bomb, drop, fly, para, reco): Use it.
This commit is contained in:
Markus Armbruster 2005-10-01 14:07:35 +00:00
parent 267a9ef424
commit caac6e41ca
7 changed files with 43 additions and 64 deletions

View file

@ -47,7 +47,6 @@
int
drop(void)
{
s_char *p;
int mission_flags;
coord tx, ty;
coord ax, ay;
@ -56,7 +55,6 @@ drop(void)
s_char flightpath[MAX_PATH_LEN];
struct nstr_item ni_bomb;
struct nstr_item ni_esc;
coord x, y;
struct sctstr target;
struct emp_qelem bomb_list;
struct emp_qelem esc_list;
@ -70,18 +68,10 @@ drop(void)
if (!snxtitem(&ni_esc, EF_PLANE,
getstarg(player->argp[2], "escort(s)? ", buf)))
pr("No escorts...\n");
if ((p = getstarg(player->argp[3], "assembly point? ", buf)) == 0
|| *p == 0)
if (!get_assembly_point(player->argp[3], &ap_sect, buf))
return RET_SYN;
if (!sarg_xy(p, &x, &y) || !getsect(x, y, &ap_sect))
return RET_SYN;
if (ap_sect.sct_own && ap_sect.sct_own != player->cnum &&
getrel(getnatp(ap_sect.sct_own), player->cnum) != ALLIED) {
pr("Assembly point not owned by you or an ally!\n");
return RET_SYN;
}
ax = x;
ay = y;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
if (getpath(flightpath, player->argp[4], ax, ay, 0, 0, P_FLYING) == 0
|| *flightpath == 0)
return RET_SYN;