Drop last parameter of shp_hit_mine() and lnd_hit_mine()

This commit is contained in:
Markus Armbruster 2010-01-01 16:55:24 +01:00
parent a90b3e8819
commit ef7ea8934f
2 changed files with 8 additions and 8 deletions

View file

@ -52,7 +52,7 @@
#include "unit.h" #include "unit.h"
static void lnd_mess(char *, struct ulist *); static void lnd_mess(char *, struct ulist *);
static int lnd_hit_mine(struct lndstr *, struct lchrstr *); static int lnd_hit_mine(struct lndstr *);
static int has_helpful_engineer(coord, coord, natid); static int has_helpful_engineer(coord, coord, natid);
double double
@ -623,7 +623,7 @@ lnd_check_mines(struct emp_qelem *land_list)
if (SCT_LANDMINES(&sect) == 0) if (SCT_LANDMINES(&sect) == 0)
continue; continue;
if (chance(DMINE_LHITCHANCE(sect.sct_mines) / (1 + 2 * with_eng))) { if (chance(DMINE_LHITCHANCE(sect.sct_mines) / (1 + 2 * with_eng))) {
lnd_hit_mine(&llp->unit.land, ((struct lchrstr *)llp->chrp)); lnd_hit_mine(&llp->unit.land);
sect.sct_mines--; sect.sct_mines--;
putsect(&sect); putsect(&sect);
putland(llp->unit.land.lnd_uid, &llp->unit.land); putland(llp->unit.land.lnd_uid, &llp->unit.land);
@ -840,7 +840,7 @@ lnd_hardtarget(struct lndstr *lp)
} }
static int static int
lnd_hit_mine(struct lndstr *lp, struct lchrstr *lcp) lnd_hit_mine(struct lndstr *lp)
{ {
int m; int m;
@ -850,7 +850,7 @@ lnd_hit_mine(struct lndstr *lp, struct lchrstr *lcp)
nreport(lp->lnd_own, N_LHIT_MINE, 0, 1); nreport(lp->lnd_own, N_LHIT_MINE, 0, 1);
m = MINE_LDAMAGE(); m = MINE_LDAMAGE();
if (lcp->l_flags & L_ENGINEER) if (lchr[lp->lnd_uid].l_flags & L_ENGINEER)
m /= 2; m /= 2;
landdamage(lp, m); landdamage(lp, m);

View file

@ -53,7 +53,7 @@
#include "unit.h" #include "unit.h"
static int shp_check_one_mines(struct ulist *); static int shp_check_one_mines(struct ulist *);
static int shp_hit_mine(struct shpstr *, struct mchrstr *); static int shp_hit_mine(struct shpstr *);
static void shp_mess(char *, struct ulist *); static void shp_mess(char *, struct ulist *);
void void
@ -241,7 +241,7 @@ shp_check_one_mines(struct ulist *mlp)
return 0; return 0;
if (chance(DMINE_HITCHANCE(sect.sct_mines))) { if (chance(DMINE_HITCHANCE(sect.sct_mines))) {
actor = mlp->unit.ship.shp_own; actor = mlp->unit.ship.shp_own;
shp_hit_mine(&mlp->unit.ship, ((struct mchrstr *)mlp->chrp)); shp_hit_mine(&mlp->unit.ship);
sect.sct_mines--; sect.sct_mines--;
if (map_set(actor, sect.sct_x, sect.sct_y, 'X', 0)) if (map_set(actor, sect.sct_x, sect.sct_y, 'X', 0))
writemap(actor); writemap(actor);
@ -687,7 +687,7 @@ shp_hardtarget(struct shpstr *sp)
} }
static int static int
shp_hit_mine(struct shpstr *sp, struct mchrstr *mcp) shp_hit_mine(struct shpstr *sp)
{ {
double m; double m;
@ -697,7 +697,7 @@ shp_hit_mine(struct shpstr *sp, struct mchrstr *mcp)
nreport(sp->shp_own, N_HIT_MINE, 0, 1); nreport(sp->shp_own, N_HIT_MINE, 0, 1);
m = MINE_DAMAGE(); m = MINE_DAMAGE();
if (mcp->m_flags & M_SWEEP) if (mchr[sp->shp_uid].m_flags & M_SWEEP)
m /= 2.0; m /= 2.0;
shipdamage(sp, ldround(m, 1)); shipdamage(sp, ldround(m, 1));