(lnd_hit_mine): Remove silly use of double. Rounds fractional damage

to engineers down instead of up.

(retreat_land1): Failed to reduce mine damage to engineers.
This commit is contained in:
Markus Armbruster 2006-06-15 18:58:47 +00:00
parent 5dcd0dcd86
commit ded3ca41ef
2 changed files with 6 additions and 5 deletions

View file

@ -976,7 +976,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, struct lchrstr *lcp)
{ {
double m; int m;
mpr(lp->lnd_own, "Blammo! Landmines detected in %s! ", mpr(lp->lnd_own, "Blammo! Landmines detected in %s! ",
xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own)); xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
@ -985,11 +985,10 @@ lnd_hit_mine(struct lndstr *lp, struct lchrstr *lcp)
m = MINE_LDAMAGE(); m = MINE_LDAMAGE();
if (lcp->l_flags & L_ENGINEER) if (lcp->l_flags & L_ENGINEER)
m /= 2.0; m /= 2;
landdamage(lp, ldround(m, 1)); landdamage(lp, m);
return m;
return (int)m;
} }
double double

View file

@ -500,6 +500,8 @@ retreat_land1(struct lndstr *lp, char code, int orig)
xyas(newx, newy, lp->lnd_own)); xyas(newx, newy, lp->lnd_own));
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)
m /= 2;
landdamage(lp, m); landdamage(lp, m);
mines--; mines--;
sect.sct_mines = mines; sect.sct_mines = mines;