(effrange, torprange, fortrange): New.
(multifire, quiet_bigdef, torp, anti_torp, sd, sb) (lnd_fort_interdiction, lnd_support, perform_mission, oprange) (shp_fort_interdiction): Use them. This fixes forts shooting below FORTEFF in quiet_bigdef(), lnd_fort_interdiction() and shp_fort_interdiction(). Change variables for rounded ranges to int. (quiet_bigdef, sd): Don't scale ship firing range by efficiency. (dd, sb): Simplify. (sb): Internal linkage. (perform_mission): Rename range2 to vrange.
This commit is contained in:
parent
5b4b3a13cb
commit
a50ae4a3d8
8 changed files with 107 additions and 143 deletions
|
@ -631,8 +631,8 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy,
|
|||
{
|
||||
struct nstr_sect ns;
|
||||
struct sctstr fsect;
|
||||
int trange;
|
||||
double range, range2, guneff;
|
||||
int trange, range;
|
||||
double guneff;
|
||||
int shell, gun;
|
||||
int dam;
|
||||
int totdam = 0;
|
||||
|
@ -670,17 +670,12 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy,
|
|||
while (nxtsct(&ns, &fsect)) {
|
||||
if (!notified[fsect.sct_own])
|
||||
continue;
|
||||
if (fsect.sct_type != SCT_FORTR)
|
||||
continue;
|
||||
gun = fsect.sct_item[I_GUN];
|
||||
if (gun < 1)
|
||||
continue;
|
||||
range = tfactfire(fsect.sct_own, MIN(gun, 7));
|
||||
if (fsect.sct_effic > 59)
|
||||
range++;
|
||||
range2 = roundrange(range);
|
||||
range = roundrange(fortrange(&fsect));
|
||||
trange = mapdist(newx, newy, fsect.sct_x, fsect.sct_y);
|
||||
if (trange > range2)
|
||||
if (trange > range)
|
||||
continue;
|
||||
if (fsect.sct_item[I_MILIT] < 5)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue