Factor out ship firing range calculation into shp_fire_range()
This commit is contained in:
parent
b3c5ba2f75
commit
ad5f8e8904
6 changed files with 16 additions and 7 deletions
|
@ -530,7 +530,7 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
|
|||
"Incoming torpedo sighted @ %s hits and does %d damage!\n",
|
||||
xyas(x, y, victim), dam2);
|
||||
} else {
|
||||
range = roundrange(effrange(sp->shp_frnge, sp->shp_tech));
|
||||
range = roundrange(shp_fire_range(sp));
|
||||
if (md > range)
|
||||
continue;
|
||||
if (mission == MI_SINTERDICT)
|
||||
|
@ -835,8 +835,7 @@ oprange(struct empobj *gp, int *radius)
|
|||
|
||||
switch (gp->ef_type) {
|
||||
case EF_SHIP:
|
||||
range = ldround(effrange(((struct shpstr *)gp)->shp_frnge,
|
||||
((struct shpstr *)gp)->shp_tech), 1);
|
||||
range = ldround(shp_fire_range((struct shpstr *)gp), 1);
|
||||
break;
|
||||
case EF_LAND:
|
||||
range = ldround(effrange(((struct lndstr *)gp)->lnd_frg,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue