Factor out ship firing range calculation into shp_fire_range()

This commit is contained in:
Markus Armbruster 2008-03-03 20:20:39 +01:00
parent b3c5ba2f75
commit ad5f8e8904
6 changed files with 16 additions and 7 deletions

View file

@ -306,7 +306,7 @@ multifire(void)
fshipno, fship.shp_effic);
continue;
}
range = effrange(fship.shp_frnge, fship.shp_tech);
range = shp_fire_range(&fship);
range2 = roundrange(range);
pr("range is %d.00 (%.2f)\n", range2, range);
if (target == targ_sub
@ -746,7 +746,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
continue;
dam += dam2;
} else {
erange = effrange(ship.shp_frnge, ship.shp_tech);
erange = shp_fire_range(&ship);
if (roundrange(erange) < ni.curdist)
continue;
dam2 = shp_fire(&ship);