From 7b700e82c6e582324db094dd477508e16208fce8 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 7 Feb 2015 17:57:54 +0100 Subject: [PATCH] fire: Always clear mission when firing 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 --- src/lib/commands/mfir.c | 16 ++-------------- tests/fire/final.xdump | 10 +++++----- tests/fire/journal.log | 5 ----- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index ef8859408..3e58b5548 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -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; } diff --git a/tests/fire/final.xdump b/tests/fire/final.xdump index 0483034b5..35dc01490 100644 --- a/tests/fire/final.xdump +++ b/tests/fire/final.xdump @@ -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 diff --git a/tests/fire/journal.log b/tests/fire/journal.log index 1ae2d8b43..0386fc481 100644 --- a/tests/fire/journal.log +++ b/tests/fire/journal.log @@ -1341,9 +1341,6 @@ 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 @@ -1396,8 +1393,6 @@ 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 -- 2.43.0