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

@ -241,7 +241,7 @@ fire_dchrg(struct shpstr *sp, struct shpstr *targ, int ntargets)
{
int range, erange, dam;
erange = roundrange(effrange(sp->shp_frnge, sp->shp_tech));
erange = roundrange(shp_fire_range(sp));
range = mapdist(sp->shp_x, sp->shp_y, targ->shp_x, targ->shp_y);
if (range > erange)
return;