msl_equip() used mission_pln_equip(), which is for automatic defenses,
and therefore silent. Its users launch_as(), launch_missile() and
launch_sat() printed failure diagnostics based on assumptions on what
could go wrong.
Switch to the appropriate function for commands, pln_equip(), and
remove the guesswork. Implement mission 'i' there. When launching
from a foreign base, its owner now gets informed. Unimportant at this
time, as players can't easily deploy missiles in foreign bases.
This change also switches off automatic supply for launch. Consistent
with bomb.
extern void pln_sel(struct nstr_item *, struct emp_qelem *,
struct sctstr *, int, int, int, int);
extern void pln_arm(struct emp_qelem *, int, char, struct ichrstr *);
extern void pln_sel(struct nstr_item *, struct emp_qelem *,
struct sctstr *, int, int, int, int);
extern void pln_arm(struct emp_qelem *, int, char, struct ichrstr *);
+extern int pln_equip(struct plist *, struct ichrstr *, char);
extern int pln_mobcost(int, struct plnstr *, char);
extern void pln_put(struct emp_qelem *);
extern void pln_put1(struct plist *);
extern int pln_mobcost(int, struct plnstr *, char);
extern void pln_put(struct emp_qelem *);
extern void pln_put1(struct plist *);
pr("Range too great!\n");
return RET_FAIL;
}
pr("Range too great!\n");
return RET_FAIL;
}
- if (msl_equip(pp, 'i') < 0) {
- pr("%s not enough petrol or shells!\n", prplane(pp));
+ if (msl_equip(pp, 'i') < 0)
if (msl_hit(pp, pln_def(&plane), EF_PLANE, N_SAT_KILL, N_SAT_KILL,
prplane(&plane), plane.pln_x, plane.pln_y, plane.pln_own)) {
pr("Satellite shot down\n");
if (msl_hit(pp, pln_def(&plane), EF_PLANE, N_SAT_KILL, N_SAT_KILL,
prplane(&plane), plane.pln_x, plane.pln_y, plane.pln_own)) {
pr("Satellite shot down\n");
pr("Range too great; try again!\n");
return RET_FAIL;
}
pr("Range too great; try again!\n");
return RET_FAIL;
}
- if (msl_equip(pp, 'p') < 0) {
- pr("%s not enough shells!\n", prplane(pp));
+ if (msl_equip(pp, 'p') < 0)
if (!(pcp->pl_flags & P_MAR)) {
getsect(sx, sy, §);
if (opt_SLOW_WAR) {
if (!(pcp->pl_flags & P_MAR)) {
getsect(sx, sy, §);
if (opt_SLOW_WAR) {
return RET_SYN;
if (!check_plane_ok(pp))
return RET_FAIL;
return RET_SYN;
if (!check_plane_ok(pp))
return RET_FAIL;
- if (msl_equip(pp, 'r') < 0) {
- pr("%s not enough petrol!\n", prplane(pp));
+ if (msl_equip(pp, 'r') < 0)
pp->pln_theta = 0;
pp->pln_flags |= PLN_SYNCHRONOUS;
if (*p == 0 || *p == 'n')
pp->pln_theta = 0;
pp->pln_flags |= PLN_SYNCHRONOUS;
if (*p == 0 || *p == 'n')
memset(&pl, 0, sizeof(struct plist));
pl.pcp = plchr + pp->pln_type;
pl.plane = *pp;
memset(&pl, 0, sizeof(struct plist));
pl.pcp = plchr + pp->pln_type;
pl.plane = *pp;
- return mission_pln_equip(&pl, NULL, mission);
+ return pln_equip(&pl, NULL, mission);
#include "ship.h"
#include "xy.h"
#include "ship.h"
#include "xy.h"
-static int pln_equip(struct plist *, struct ichrstr *, char);
static int fit_plane_on_ship(struct plnstr *, struct shpstr *);
/*
static int fit_plane_on_ship(struct plnstr *, struct shpstr *);
/*
pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
{
struct plchrstr *pcp;
pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
{
struct plchrstr *pcp;
break;
case 'r': /* reconnaissance */
case 'e': /* escort */
break;
case 'r': /* reconnaissance */
case 'e': /* escort */
+ case 'i': /* missile interception */
+ if (CANT_HAPPEN(!(pcp->pl_flags & P_M)
+ || !(pcp->pl_flags & (P_N | P_O))))
+ break;
+ if (load)
+ itype = I_SHELL;
break;
default:
CANT_REACH();
break;
default:
CANT_REACH();