diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 4248f19e..955cdd24 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -856,7 +856,7 @@ calc_mobcost(int combat_mode, struct combat *off, struct combat *def, case EF_SHIP: /* the 2 in the formula below is a fudge factor */ getship(def->shp_uid, &ship); - off->mobcost += (def->eff / 100) * (shp_speed(&ship) / 2); + off->mobcost += shp_speed(&ship) / 2 * def->eff / 100; } } } diff --git a/tests/retreat/final.xdump b/tests/retreat/final.xdump index 874d35b0..aa32bc4f 100644 --- a/tests/retreat/final.xdump +++ b/tests/retreat/final.xdump @@ -30,7 +30,7 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil 2 1 -3 1 10 93 118 0 45 0 0 none 0 "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured torpedoed sonared helpless bombed depth-charged boarded) "bgyujnbgy" 3 1 -3 1 10 100 127 0 45 0 0 none 0 "a" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 () "" 4 1 -5 1 10 100 127 0 45 0 0 none 0 "a" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (group helpless) "b" -5 1 -5 1 17 96 63 0 70 0 0 none 0 "" 0 6 31 1 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 () "" +5 1 -5 1 17 96 61 0 70 0 0 none 0 "" 0 6 31 1 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 () "" 6 1 -1 3 18 100 97 0 165 0 0 none 0 "" 0 10 21 1 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 () "" 7 1 -5 1 10 100 127 0 45 0 0 none 0 "a" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (group helpless) "b" 9 2 -4 -2 17 60 127 0 70 0 0 none 0 "" 0 60 38 1 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 () "" diff --git a/tests/retreat/journal.log b/tests/retreat/journal.log index fee3e622..16343a97 100644 --- a/tests/retreat/journal.log +++ b/tests/retreat/journal.log @@ -1548,7 +1548,7 @@ Play#0 output Play#0 1 1 2 lc light cruis -3,1 93% 0 9 0 0 0 0 0 0 118 45 Play#0 output Play#0 1 1 3 lc light cruis -3,1 a 100% 0 10 0 0 0 0 0 0 127 45 Play#0 output Play#0 1 1 4 lc light cruis -5,1 a 100% 0 10 0 0 0 0 0 0 127 45 - Play#0 output Play#0 1 1 5 dd destroyer -5,1 96% 0 6 0 0 0 0 0 0 63 70 + Play#0 output Play#0 1 1 5 dd destroyer -5,1 96% 0 6 0 0 0 0 0 0 61 70 Play#0 output Play#0 1 1 6 sb submarine -1,3 100% 0 10 0 0 0 0 0 0 97 165 Play#0 output Play#0 1 1 7 lc light cruis -5,1 a 100% 0 10 0 0 0 0 0 0 127 45 Play#0 output Play#0 1 2 9 dd destroyer -4,-2 60% 0 60 0 0 0 0 0 0 127 70