]> git.pond.sub.org Git - empserver/commitdiff
Make drop require capability cargo
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Sep 2009 17:32:34 +0000 (13:32 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Dec 2009 07:15:51 +0000 (08:15 +0100)
Before, drop worked like fly: it accepted any plane, but planes
without capability cargo dropped nothing.

Partial fix for #1388263.

info/drop.t
src/lib/commands/drop.c

index b6ffeeb5ae4d4748a23613cdf75e037f18b5aeda..85656463219aa4f6733ae0d3f94a43a849d98c40 100644 (file)
@@ -8,9 +8,9 @@ battle.
 .s1
 <TRANSPORTS> represents a list of planes to transport commodities to
 the target sector.
-Only planes with sufficient mobility, based in a sector stocked with
-petrol and the commodities to transport, will be successfully selected
-for the mission.
+Only planes with capability cargo and sufficient mobility, based in a
+sector stocked with petrol and the commodities to transport, will be
+successfully selected for the mission.
 .s1
 <ESCORTS> represent a list of fighter planes which are capable of escorting
 the transports all the way to the target.
@@ -22,8 +22,7 @@ The assembly point must be owned by you or an ally, or you or an ally
 must have a ship there.  It must not be more than
 four sectors away from any of the planes selected for the mission.
 .s1
-<COMMODITY> is the name of a commodity which is to be carried along
-on all of the planes which have a transport capacity.
+<COMMODITY> is the name of the commodity which is to be dropped.
 .s1
 Route is a normal empire path specification. You may also give a
 destination sector on the command line, or at any time while giving
index b3c14009f12280b006073728e5673a4d49d9dc18..308fa8e2273c566469d1241c62c64607eeb0f11a 100644 (file)
@@ -57,7 +57,6 @@ drop(void)
     struct sctstr ap_sect;
     char buf[1024];
 
-    wantflags = 0;
     if (get_planes(&ni_bomb, &ni_esc, player->argp[1], player->argp[2]) < 0)
        return RET_SYN;
     if (!get_assembly_point(player->argp[3], &ap_sect, buf))
@@ -77,16 +76,19 @@ drop(void)
 
     if (target.sct_own == player->cnum
        || getrel(getnatp(target.sct_own), player->cnum) == ALLIED) {
+       /* own or allied sector: cargo drop */
        if (ip->i_uid == I_CIVIL && target.sct_own != target.sct_oldown) {
            pr("Can't drop civilians into occupied sectors.\n");
            return RET_FAIL;
        }
+       wantflags = P_C;
     } else {
        /* into the unknown... */
        if (ip->i_uid != I_SHELL) {
            pr("You don't own %s!\n", xyas(tx, ty, player->cnum));
            return RET_FAIL;
        }
+       /* mine drop */
        wantflags = P_MINE;
     }