]> git.pond.sub.org Git - empserver/commitdiff
Make sweep require capability sweep
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Sep 2009 17:53:40 +0000 (13:53 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Dec 2009 07:15:51 +0000 (08:15 +0100)
Before, sweep accepted any plane.  Planes without capability sweep
flew an ordinary recon mission.

Partial fix for #1388263.

info/sweep.t
src/lib/commands/reco.c

index 91527152112af157805f3559ff957013dc35b367..1fba8eca0041d116e95e233c9c0c272d27ea4462 100644 (file)
@@ -2,14 +2,14 @@
 .NA sweep "Use planes to remove mines from sea sectors"
 .LV Expert
 .SY "sweep <PLANES> <ESCORTS> <SECT> route|destination"
-The \*Qsweep\*U command is identical to the recon command, except
-that if you use planes capable of minesweeping, they will sweep
-sea mines from sectors along their route.
+The \*Qsweep\*U command is used to sweep sea mines from the sectors
+along the route.
 .s1
 <PLANES> represents a list of planes which are to perform the
-intelligence gathering operation.
-Only planes with sufficient mobility, based in a sector stocked with
-petrol, will be successfully selected for the mission.
+mine-sweeping mission.
+Only planes with capability sweep and sufficient mobility, based in a
+sector stocked with petrol, 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.
@@ -38,20 +38,14 @@ info \*QIntercept\*U.
 If the destination sector is not an airport, then all planes in
 the mission must have V/STOL capability.
 .s1
-Planes with the ASW ability will
-perform a sonar search on each sector as they fly through it.
-Each sub contact will be reported only once, giving the sector and number
-of the sub, from the sector in which it
-is first detected (which may not be the sector the sub is in, as plane
-sonar has a range dependent on acc, and a chance of finding a sub of
-((100-acc)-(4-sub visib)*10))+((100-effic)/5) percent.
-The sub being sonared may detect the sonar ping.
-.s1
-Planes with the sweep ability will
+Planes will
 automatically attempt to sweep sea mines in sea sectors they overfly.
 Their chance of sweeping is (100-acc), and they can only sweep 1 mine per
 overflight of the sector.
 .s1
+The planes will additionally gather intelligence, just like they do on
+a recon mission.  See info \*Qrecon\*U.
+.s1
 Note that a plane must be at least 40% efficient before it can leave
 the ground.
 .s1
index 18981d936d827a8b72fc427e1b4e72d7e2baf92f..1716328661271430159e7e052955e125b23d69e7 100644 (file)
@@ -41,6 +41,7 @@
 int
 reco(void)
 {
+    int mission_flags = player->argp[0][0] == 's' ? PM_R | PM_S : PM_R;
     coord tx, ty;
     coord ax, ay;
     int ap_to_target;
@@ -81,7 +82,7 @@ reco(void)
      * select planes within range
      */
     pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
-           1, wantflags, P_M | P_O);
+           1, wantflags | (mission_flags & PM_S ? P_SWEEP : 0), P_M | P_O);
     if (QEMPTY(&bomb_list)) {
        pr("No planes could be equipped for the mission.\n");
        return RET_FAIL;
@@ -101,8 +102,7 @@ reco(void)
        return RET_FAIL;
     }
     pln_arm(&esc_list, ap_to_target, 'e', NULL);
-    ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath,
-                *player->argp[0] == 's' ? PM_R | PM_S : PM_R);
+    ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, mission_flags);
     if (QEMPTY(&bomb_list)) {
        pr("No planes got through fighter defenses\n");
     } else {