(shp_mobcost): New.

(use_ammo, eta_calc, torp, fire_torp, perform_mission, retreat_ship1)
(shp_sweep, shp_nav_one_sector, cost_ship): Use it.

(perform_mission): Fix mobility cost of torpedo: charged full sector
cost instead of half.
This commit is contained in:
Markus Armbruster 2006-05-20 19:28:29 +00:00
parent 2cd8e99f49
commit 16b9c41b39
8 changed files with 18 additions and 54 deletions

View file

@ -246,8 +246,7 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
mcp = &mchr[(int)sp->shp_type];
newx = xnorm(sp->shp_x + dx);
newy = ynorm(sp->shp_y + dy);
mobcost = sp->shp_effic * 0.01 * sp->shp_speed;
mobcost = 480.0 / (mobcost + techfact(sp->shp_tech, mobcost));
mobcost = shp_mobcost(sp);
getsect(newx, newy, &sect);
if (shp_check_nav(&sect, sp) != CN_NAVIGABLE ||