(ac_airtoair): No need to pass def_own, as the owner of the intercepting

planes is used anyway.  Clean up other unaccessed variables in the process.
No functional changes.
This commit is contained in:
Marc Olzheim 2004-12-14 17:21:05 +00:00
parent 70e1ee220f
commit 61cb34b7ef
3 changed files with 6 additions and 17 deletions

View file

@ -172,7 +172,7 @@ extern void ac_planedamage(struct plist *, natid, int, natid, int,
extern void ac_intercept(struct emp_qelem *, struct emp_qelem *, extern void ac_intercept(struct emp_qelem *, struct emp_qelem *,
struct emp_qelem *, natid, coord, coord); struct emp_qelem *, natid, coord, coord);
extern void ac_combat_headers(natid, natid); extern void ac_combat_headers(natid, natid);
extern void ac_airtoair(struct emp_qelem *, struct emp_qelem *, natid); extern void ac_airtoair(struct emp_qelem *, struct emp_qelem *);
extern void ac_doflak(struct emp_qelem *, struct sctstr *); extern void ac_doflak(struct emp_qelem *, struct sctstr *);
extern void ac_shipflak(struct emp_qelem *, coord, coord); extern void ac_shipflak(struct emp_qelem *, coord, coord);
extern void ac_landflak(struct emp_qelem *, coord, coord); extern void ac_landflak(struct emp_qelem *, coord, coord);

View file

@ -98,7 +98,6 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
struct shiplook head; struct shiplook head;
struct shiplook *s, *s2; struct shiplook *s, *s2;
int changed = 0; int changed = 0;
int intx, inty; /* Last sector planes intercepted over */
int intown = 0; /* Last owner to intercept */ int intown = 0; /* Last owner to intercept */
/* We want to only intercept once per sector per owner. So, if we overfly /* We want to only intercept once per sector per owner. So, if we overfly
a sector, and then overfly some land units or ships, we don't want to a sector, and then overfly some land units or ships, we don't want to
@ -256,8 +255,6 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
continue; continue;
ac_intercept(bomb_list, esc_list, &ilist[sect.sct_own], ac_intercept(bomb_list, esc_list, &ilist[sect.sct_own],
sect.sct_own, x, y); sect.sct_own, x, y);
intx = x;
inty = y;
intown = sect.sct_own; intown = sect.sct_own;
} }
@ -511,8 +508,8 @@ ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
PR(def_own, "%d fighter%s intercepting %s planes!\n", icount, PR(def_own, "%d fighter%s intercepting %s planes!\n", icount,
icount == 1 ? " is" : "s are", cname(plane_owner)); icount == 1 ? " is" : "s are", cname(plane_owner));
ac_combat_headers(plane_owner, def_own); ac_combat_headers(plane_owner, def_own);
ac_airtoair(esc_list, &int_list, def_own); ac_airtoair(esc_list, &int_list);
ac_airtoair(bomb_list, &int_list, def_own); ac_airtoair(bomb_list, &int_list);
PR(plane_owner, "\n"); PR(plane_owner, "\n");
PR(def_own, "\n"); PR(def_own, "\n");
} }
@ -532,8 +529,7 @@ ac_combat_headers(natid plane_owner, natid def_own)
* air-to-air combat. * air-to-air combat.
*/ */
void void
ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list, ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
natid def_own)
{ {
struct plist *attacker; struct plist *attacker;
struct plist *interceptor; struct plist *interceptor;
@ -544,7 +540,6 @@ ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list,
int more_int; int more_int;
struct emp_qelem *att_next; struct emp_qelem *att_next;
struct emp_qelem *in_next; struct emp_qelem *in_next;
natid att_own;
att = att_list->q_forw; att = att_list->q_forw;
in = int_list->q_forw; in = int_list->q_forw;
@ -574,8 +569,6 @@ ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list,
continue; continue;
} }
interceptor = (struct plist *)in; interceptor = (struct plist *)in;
att_own = attacker->plane.pln_own;
def_own = interceptor->plane.pln_own;
nplanes = attacker->plane.pln_effic; nplanes = attacker->plane.pln_effic;
if (nplanes > interceptor->plane.pln_effic) if (nplanes > interceptor->plane.pln_effic)
nplanes = interceptor->plane.pln_effic; nplanes = interceptor->plane.pln_effic;

View file

@ -140,12 +140,10 @@ only_subs(struct emp_qelem *list)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;
struct genlist *glp; struct genlist *glp;
struct genitem *gp;
struct mchrstr *mcp; struct mchrstr *mcp;
for (qp = list->q_forw; qp != list; qp = qp->q_forw) { for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
glp = (struct genlist *)qp; glp = (struct genlist *)qp;
gp = (struct genitem *)glp->thing;
if (glp->type != EF_SHIP) if (glp->type != EF_SHIP)
return 0; return 0;
@ -442,7 +440,6 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
struct lndstr *lp; struct lndstr *lp;
struct shpstr *sp; struct shpstr *sp;
struct sctstr sect; struct sctstr sect;
struct lchrstr *lcp;
struct mchrstr *mcp; struct mchrstr *mcp;
struct plchrstr *pcp; struct plchrstr *pcp;
int dam = 0, dam2, mission_flags, tech; int dam = 0, dam2, mission_flags, tech;
@ -465,7 +462,6 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
if (glp->type == EF_LAND) { if (glp->type == EF_LAND) {
lp = (struct lndstr *)glp->thing; lp = (struct lndstr *)glp->thing;
lcp = (struct lchrstr *)glp->cp;
if (lp->lnd_effic < LAND_MINFIREEFF) if (lp->lnd_effic < LAND_MINFIREEFF)
continue; continue;
@ -1681,7 +1677,7 @@ air_defense(coord x, coord y, natid victim, struct emp_qelem *bomb_list,
mpr(victim, "%s air defense planes intercept!\n", mpr(victim, "%s air defense planes intercept!\n",
cname(cn)); cname(cn));
ac_combat_headers(victim, cn); ac_combat_headers(victim, cn);
ac_airtoair(esc_list, &i, air->own); ac_airtoair(esc_list, &i);
combat = 1; combat = 1;
} }
/* Now intercept the bombers */ /* Now intercept the bombers */
@ -1691,7 +1687,7 @@ air_defense(coord x, coord y, natid victim, struct emp_qelem *bomb_list,
cname(cn)); cname(cn));
ac_combat_headers(victim, cn); ac_combat_headers(victim, cn);
} }
ac_airtoair(bomb_list, &i, air->own); ac_airtoair(bomb_list, &i);
PR(cn, "\n"); PR(cn, "\n");
PR(victim, "\n"); PR(victim, "\n");
} }