board: Fix mobility cost when defender's efficiency < 100%

The cost is meant to be proportional to efficiency / 100, but the code
truncates the fraction to zero.  Broken in Empire 2.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2015-02-03 07:44:23 +01:00
parent 39884aff59
commit 48d8533443
3 changed files with 3 additions and 3 deletions

View file

@ -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;
}
}
}