Don't store land unit stats in struct lndstr, part 1
New lnd_att(), lnd_def(), lnd_vul(), lnd_spd(), lnd_vis(), lnd_frg(), lnd_acc(), lnd_dam(), lnd_aaf() replace the struct lndstr members with the same names. Make land unit selectors att, def, vul, spd, vis, frg, acc, dam, aaf virtual.
This commit is contained in:
parent
f86d726406
commit
cdf1bcfa22
13 changed files with 185 additions and 68 deletions
|
@ -712,7 +712,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
|
|||
struct lndstr land;
|
||||
struct emp_qelem *qp;
|
||||
int unitno;
|
||||
int ignore, flak, hitchance;
|
||||
int ignore, aaf, flak, hitchance;
|
||||
struct plist *plp;
|
||||
int nukedam;
|
||||
int nunits;
|
||||
|
@ -755,11 +755,12 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
|
|||
if (unitno < 0)
|
||||
continue;
|
||||
|
||||
flak = (int)(techfact(land.lnd_tech, land.lnd_aaf) * 3.0);
|
||||
aaf = lnd_aaf(&land);
|
||||
flak = (int)(techfact(land.lnd_tech, aaf) * 3.0);
|
||||
if (flak) {
|
||||
PR(land.lnd_own,
|
||||
"Flak! Firing flak guns from unit %s (aa rating %d)\n",
|
||||
prland(&land), land.lnd_aaf);
|
||||
prland(&land), aaf);
|
||||
if (pinflak_planedamage(&plp->plane, plp->pcp, land.lnd_own, flak))
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue