diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 4b034922..1e5a6c6b 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -54,11 +54,9 @@ struct flist { static void add_to_fired_queue(struct emp_qelem *, struct emp_qelem *); static int defend(struct emp_qelem *al, struct emp_qelem *dl, - enum targ_type target, + natid, enum targ_type attacker, - struct sctstr *vsect, struct sctstr *fsect, - struct shpstr *vship, struct shpstr *fship, int fx, int fy, int *nd); static void do_defdam(struct emp_qelem *, double); static int quiet_bigdef(int, struct emp_qelem *, natid, natid, coord, @@ -557,8 +555,8 @@ multifire(void) getsect(fland.lnd_x, fland.lnd_y, &fsect); } totaldefdam = - defend(&fired, &defended, target, attacker, &vsect, &fsect, - &vship, &fship, fx, fy, &ndefending); + defend(&fired, &defended, vict, attacker, + &fsect, &fship, fx, fy, &ndefending); switch (target) { case targ_land: putsect(&vsect); @@ -595,13 +593,13 @@ multifire(void) } static int -defend(struct emp_qelem *al, struct emp_qelem *dl, enum targ_type target, - enum targ_type attacker, struct sctstr *vsect, struct sctstr *fsect, - struct shpstr *vship, struct shpstr *fship, int fx, int fy, int *nd) +defend(struct emp_qelem *al, struct emp_qelem *dl, natid vict, + enum targ_type attacker, struct sctstr *fsect, + struct shpstr *fship, int fx, int fy, int *nd) { int dam; - int vict, nfiring = 0; + int nfiring = 0; struct flist *fp; int aown; @@ -610,11 +608,6 @@ defend(struct emp_qelem *al, struct emp_qelem *dl, enum targ_type target, else aown = fship->shp_own; - if (target == targ_land) - vict = vsect->sct_own; - else - vict = vship->shp_own; - if (0 != (dam = quiet_bigdef(attacker, dl, vict, aown, fx, fy, &nfiring))) { if (nfiring > *nd)