]> git.pond.sub.org Git - empserver/commitdiff
fire: Always clear mission when firing
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 7 Feb 2015 16:57:54 +0000 (17:57 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:51 +0000 (08:20 +0100)
Mission is cleared only when firing at a target that is out of range.
Screwed up when missions were added in Chainsaw.  Always clear it when
firing.  Matches torpedo.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/mfir.c
tests/fire/final.xdump
tests/fire/journal.log

index ef88594086fe76746297c16bdf2d1cc3df6c7fcb..3e58b55487aaa74fdccaed18fb74847b017f5704 100644 (file)
@@ -286,6 +286,7 @@ multifire(void)
                }
                dam = shp_fire(&fship);
            }
+           fship.shp_mission = 0;
            putship(fship.shp_uid, &fship);
            if (CANT_HAPPEN(dam < 0)) {
                pr("Klick!     ...\n");
@@ -315,6 +316,7 @@ multifire(void)
            }
 
            dam = lnd_fire(&fland);
+           fland.lnd_mission = 0;
            putland(fland.lnd_uid, &fland);
            if (CANT_HAPPEN(dam < 0)) {
                pr("Klick!     ...\n");
@@ -350,20 +352,6 @@ multifire(void)
        }
        if (trange > range2) {
            pr("Target out of range.\n");
-           switch (type) {
-           case EF_SECTOR:
-               break;
-           case EF_LAND:
-               fland.lnd_mission = 0;
-               putland(fland.lnd_uid, &fland);
-               break;
-           case EF_SHIP:
-               fship.shp_mission = 0;
-               putship(fship.shp_uid, &fship);
-               break;
-           default:
-               CANT_REACH();
-           }
            continue;
        }
 
index 0483034b58b5f895c5be6ac708696fe6fddb8c71..35dc01490c08fce8721dd5764e27ea406476d036 100644 (file)
@@ -24,11 +24,11 @@ config ship
 uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime access name xbuilt ybuilt builder rflags rpath
 0 2 -12 0 6 20 0 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
 1 1 3 1 13 59 127 0 150 3 1 interdiction 4 "" 0 13 100 10 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
-2 1 3 1 13 60 127 0 150 3 1 interdiction 4 "" 0 13 96 10 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
+2 1 3 1 13 60 127 0 150 3 1 none 4 "" 0 13 96 10 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
 3 1 3 1 13 100 127 0 150 3 1 none 4 "" 0 13 72 10 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
-4 1 3 1 13 100 127 0 150 3 1 interdiction 4 "" 0 13 90 10 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
+4 1 3 1 13 100 127 0 150 3 1 none 4 "" 0 13 90 10 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
 5 1 10 0 17 100 117 0 100 8 0 none 2 "" 0 5 24 4 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
-6 1 3 3 17 100 127 0 100 3 3 interdiction 2 "" 0 5 36 4 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
+6 1 3 3 17 100 127 0 100 3 3 none 2 "" 0 5 36 4 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
 8 1 3 1 2 100 0 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
 9 1 5 1 2 98 124 0 20 0 0 none 0 "" 0 10 10 9 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
 10 0 2 2 18 0 0 0 60 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -12 0 0 () ""
@@ -62,9 +62,9 @@ config land
 uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship harden retreat rflags rpath civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime land access
 0 0 2 2 8 0 127 0 40 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 1 1 3 1 13 39 127 0 160 3 1 interdiction 4 "" -1 0 42 () "" 0 10 40 12 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-2 1 3 1 13 40 127 0 160 3 1 interdiction 4 "" -1 0 42 () "" 0 10 36 12 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+2 1 3 1 13 40 127 0 160 3 1 none 4 "" -1 0 42 () "" 0 10 36 12 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 3 1 3 1 13 100 127 0 160 3 1 none 4 "" -1 0 42 () "" 0 10 16 12 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-4 1 3 1 13 100 127 0 160 3 1 interdiction 4 "" -1 0 42 () "" 0 10 31 12 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+4 1 3 1 13 100 127 0 160 3 1 none 4 "" -1 0 42 () "" 0 10 31 12 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 5 1 0 -2 13 100 127 0 160 0 -2 none 4 "" -1 0 42 () "" 0 10 16 12 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 8 1 3 1 7 100 127 0 40 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 9 1 1 1 6 100 0 0 50 0 0 none 0 "" -1 0 42 () "" 0 10 10 10 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
index 1ae2d8b4395e2f1e2b96acd8cbfc3a3ff7265187..0386fc481161e0b167566a94c99b82f83b059829 100644 (file)
     Play#0 command mission
     Play#0 output Play#0 1 Thing                        x,y     op-sect  rad mission
     Play#0 output Play#0 1 bb   battleship (#1)         3,1       3,1      4 is on an interdiction mission
-    Play#0 output Play#0 1 bb   battleship (#2)         3,1       3,1      4 is on an interdiction mission
-    Play#0 output Play#0 1 bb   battleship (#4)         3,1       3,1      4 is on an interdiction mission
-    Play#0 output Play#0 1 dd   destroyer (#6)          3,3       3,3      2 is on an interdiction mission
     Play#0 output Play#0 6 0 638
     Play#0 input plane *
     Play#0 command plane
     Play#0 command mission
     Play#0 output Play#0 1 Thing                        x,y     op-sect  rad mission
     Play#0 output Play#0 1 hat  hvy artillery #1        3,1       3,1      4 is on an interdiction mission
-    Play#0 output Play#0 1 hat  hvy artillery #2        3,1       3,1      4 is on an interdiction mission
-    Play#0 output Play#0 1 hat  hvy artillery #4        3,1       3,1      4 is on an interdiction mission
     Play#0 output Play#0 6 0 636
     Play#0 input nuke *
     Play#0 command nuke