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:
parent
39884aff59
commit
48d8533443
3 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue