Simplify how plane cargo is tracked

Fold struct plist members bombs (used for bombing runs) and misc (used
for everything else) into a single member load.
This commit is contained in:
Markus Armbruster 2009-10-03 16:25:50 -04:00
parent d3f5fee64b
commit 54b1c04686
7 changed files with 18 additions and 28 deletions

View file

@ -492,9 +492,9 @@ ac_dog(struct plist *ap, struct plist *dp)
def = pln_def(&dp->plane) * dp->plane.pln_effic / 100;
def = MAX(def, dp->pcp->pl_def / 2);
if ((ap->pcp->pl_flags & P_F) && ap->bombs + ap->misc != 0)
if ((ap->pcp->pl_flags & P_F) && ap->load != 0)
att -= 2;
if ((dp->pcp->pl_flags & P_F) && dp->bombs + ap->misc != 0)
if ((dp->pcp->pl_flags & P_F) && dp->load != 0)
def -= 2;
att += ap->pcp->pl_stealth / 25.0;
def += dp->pcp->pl_stealth / 25.0;
@ -837,8 +837,7 @@ getilists(struct emp_qelem *list, unsigned char *rel, natid intruder)
continue;
/* got one! */
ip = malloc(sizeof(*ip));
ip->bombs = 0;
ip->misc = 0;
ip->load = 0;
ip->pcp = &plchr[(int)plane.pln_type];
ip->plane = plane;
emp_insque(&ip->queue, &list[plane.pln_own]);