Change pln_mine() parameters to match pln_dropoff()

This moves getting the target sector from caller into pln_mine().
Makes sense, because that's where it's put.
This commit is contained in:
Markus Armbruster 2008-07-12 14:43:35 -04:00
parent 27edba1f1b
commit f2294d67a4
3 changed files with 10 additions and 10 deletions

View file

@ -544,7 +544,7 @@ extern int could_be_on_ship(struct plnstr *, struct shpstr *);
extern int put_plane_on_ship(struct plnstr *, struct shpstr *); extern int put_plane_on_ship(struct plnstr *, struct shpstr *);
extern void pln_dropoff(struct emp_qelem *, struct ichrstr *, extern void pln_dropoff(struct emp_qelem *, struct ichrstr *,
coord, coord, int); coord, coord, int);
extern void pln_mine(struct emp_qelem *list, struct sctstr *sectp); extern void pln_mine(struct emp_qelem *, coord, coord);
extern int pln_capable(struct plnstr *, int, int); extern int pln_capable(struct plnstr *, int, int);
extern int pln_airbase_ok(struct plnstr *, int, int); extern int pln_airbase_ok(struct plnstr *, int, int);
extern int carrier_planes(struct shpstr *, int); extern int carrier_planes(struct shpstr *, int);

View file

@ -129,9 +129,8 @@ drop(void)
if (QEMPTY(&bomb_list)) { if (QEMPTY(&bomb_list)) {
pr("No planes got through fighter defenses\n"); pr("No planes got through fighter defenses\n");
} else { } else {
getsect(tx, ty, &target);
if (wantflags & P_MINE) if (wantflags & P_MINE)
pln_mine(&bomb_list, &target); pln_mine(&bomb_list, tx, ty);
else else
pln_dropoff(&bomb_list, ip, tx, ty, -1); pln_dropoff(&bomb_list, ip, tx, ty, -1);
} }

View file

@ -309,11 +309,12 @@ pln_dropoff(struct emp_qelem *list, struct ichrstr *ip, coord tx, coord ty,
} }
void void
pln_mine(struct emp_qelem *list, struct sctstr *sectp) pln_mine(struct emp_qelem *list, coord tx, coord ty)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;
struct plist *plp; struct plist *plp;
int amt; int amt;
struct sctstr sect;
amt = 0; amt = 0;
for (qp = list->q_forw; qp != list; qp = qp->q_forw) { for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
@ -322,16 +323,16 @@ pln_mine(struct emp_qelem *list, struct sctstr *sectp)
} }
if (amt > 0) { if (amt > 0) {
if (sectp->sct_type != SCT_WATER) { getsect(tx, ty, &sect);
if (sect.sct_type != SCT_WATER) {
pr("Your seamines have no effect here.\n"); pr("Your seamines have no effect here.\n");
return; return;
} }
sectp->sct_mines = MIN(sectp->sct_mines + amt, MINES_MAX); sect.sct_mines = MIN(sect.sct_mines + amt, MINES_MAX);
pr("%d mines laid in %s.\n", amt, pr("%d mines laid in %s.\n", amt, xyas(tx, ty, player->cnum));
xyas(sectp->sct_x, sectp->sct_y, player->cnum)); if (map_set(player->cnum, tx, ty, 'X', 0))
if (map_set(player->cnum, sectp->sct_x, sectp->sct_y, 'X', 0))
writemap(player->cnum); writemap(player->cnum);
putsect(sectp); putsect(&sect);
} }
} }