]> git.pond.sub.org Git - empserver/commitdiff
(drop): A mining mission targeting land called pln_dropoff() instead
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 23 Dec 2005 19:37:52 +0000 (19:37 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 23 Dec 2005 19:37:52 +0000 (19:37 +0000)
of pln_mine().  pln_dropoff() happens to do pretty much the right
thing, but...
(pln_mine): Refuse to mine land.

src/lib/commands/drop.c
src/lib/subs/plnsub.c

index f4da458334c7437233c93010b4ec1492413acec7..bb2c4d7e8a5a54ca7c806f6c9d7020478d8d71da 100644 (file)
@@ -135,8 +135,7 @@ drop(void)
        pr("No planes got through fighter defenses\n");
     } else {
        getsect(tx, ty, &target);
-       if (target.sct_type == SCT_WATER && (mission_flags & P_MINE)
-           && ip->i_vtype == I_SHELL)
+       if (wantflags & P_MINE)
            pln_mine(&bomb_list, &target);
        else
            pln_dropoff(&bomb_list, ip, tx, ty, &target, EF_SECTOR);
index ab7f6cf48067180dc4cce6aacfde632f2bd63418..cfdc28743ae3f81b506fccd641a131f9351b994f 100644 (file)
@@ -355,6 +355,10 @@ pln_mine(struct emp_qelem *list, struct sctstr *sectp)
 
     }
     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);
        pr("%d mines laid in %s.\n", amt,
           xyas(sectp->sct_x, sectp->sct_y, player->cnum));