(plane_sona): Compute range multiplier in double rather than int, to

match the formula used for sweep chance in plane_sweep().  Rounding
intermediate values is ugly anyway.
This commit is contained in:
Markus Armbruster 2006-05-21 08:17:15 +00:00
parent 36c73ca99a
commit 898d1422fa

View file

@ -248,10 +248,7 @@ plane_sona(struct emp_qelem *plane_list, int x, int y,
pcp = ip->pcp; pcp = ip->pcp;
if (!(pcp->pl_flags & P_A)) /* if it isn't an ASW plane */ if (!(pcp->pl_flags & P_A)) /* if it isn't an ASW plane */
continue; continue;
range = (int)techfact(pp->pln_tech, (100 - pp->pln_acc) / 10); range = (int)techfact(pp->pln_tech, (100.0 - pp->pln_acc) / 10.0);
/*
for (i=0; targ = getshipp(i); i++) {
*/
for (i = 0; getship(i, &s); i++) { for (i = 0; getship(i, &s); i++) {
targ = &s; targ = &s;
if (targ->shp_own == pp->pln_own || targ->shp_own == 0) if (targ->shp_own == pp->pln_own || targ->shp_own == 0)