(drop): A mining mission targeting land called pln_dropoff() instead

of pln_mine().  pln_dropoff() happens to do pretty much the right
thing, but...
(pln_mine): Refuse to mine land.
This commit is contained in:
Markus Armbruster 2005-12-23 19:37:52 +00:00
parent eb1134541a
commit cc0c3e4f3f
2 changed files with 5 additions and 2 deletions

View file

@ -135,8 +135,7 @@ drop(void)
pr("No planes got through fighter defenses\n"); pr("No planes got through fighter defenses\n");
} else { } else {
getsect(tx, ty, &target); getsect(tx, ty, &target);
if (target.sct_type == SCT_WATER && (mission_flags & P_MINE) if (wantflags & P_MINE)
&& ip->i_vtype == I_SHELL)
pln_mine(&bomb_list, &target); pln_mine(&bomb_list, &target);
else else
pln_dropoff(&bomb_list, ip, tx, ty, &target, EF_SECTOR); pln_dropoff(&bomb_list, ip, tx, ty, &target, EF_SECTOR);

View file

@ -355,6 +355,10 @@ pln_mine(struct emp_qelem *list, struct sctstr *sectp)
} }
if (amt > 0) { if (amt > 0) {
if (sectp->sct_type != SCT_WATER) {
pr("Your seamines have no effect here.\n");
return;
}
sectp->sct_mines = min(sectp->sct_mines + amt, MINES_MAX); sectp->sct_mines = min(sectp->sct_mines + amt, MINES_MAX);
pr("%d mines laid in %s.\n", amt, pr("%d mines laid in %s.\n", amt,
xyas(sectp->sct_x, sectp->sct_y, player->cnum)); xyas(sectp->sct_x, sectp->sct_y, player->cnum));