Fix land unit flak when pin-bombed to match flak when overflown

land_bomb() failed to reduce flak proportional to efficiency.  Missed
in commit c7f68f2e, v4.3.6.

Also change it to round randomly instead of down, to match
ac_landflak().
This commit is contained in:
Markus Armbruster 2008-08-02 18:10:49 -04:00
parent 6a95e67e4f
commit bc805ba81a

View file

@ -752,8 +752,9 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
continue; continue;
aaf = lnd_aaf(&land); aaf = lnd_aaf(&land);
flak = (int)(techfact(land.lnd_tech, aaf) * 3.0); if (aaf) {
if (flak) { flak = roundavg(techfact(land.lnd_tech,
aaf * 3.0 * land.lnd_effic / 100.0));
PR(land.lnd_own, PR(land.lnd_own,
"Flak! Firing flak guns from unit %s (aa rating %d)\n", "Flak! Firing flak guns from unit %s (aa rating %d)\n",
prland(&land), aaf); prland(&land), aaf);