From 66406d8385ad2db87785bfd6ead23a2c7470cc6f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 3 Mar 2008 20:08:43 +0100 Subject: [PATCH] Remove dead code for estimating defense Clean up of intelligence_report(). Should have been done in commit 092a52f2. --- include/land.h | 2 +- src/lib/subs/lndsub.c | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/land.h b/include/land.h index caf73062..c15a7a9e 100644 --- a/include/land.h +++ b/include/land.h @@ -186,7 +186,7 @@ extern int lnd_take_casualty(int, struct ulist *, int); extern void lnd_submil(struct lndstr *, int); extern void lnd_takemob(struct emp_qelem *, double); extern int lnd_spyval(struct lndstr *); -extern double intelligence_report(int, struct lndstr *, int, char *); +extern void intelligence_report(int, struct lndstr *, int, char *); extern int count_sect_units(struct sctstr *); extern void count_units(struct shpstr *); extern void lnd_count_units(struct lndstr *); diff --git a/src/lib/subs/lndsub.c b/src/lib/subs/lndsub.c index a6b4636e..35f6805b 100644 --- a/src/lib/subs/lndsub.c +++ b/src/lib/subs/lndsub.c @@ -327,19 +327,18 @@ lnd_spyval(struct lndstr *lp) return lp->lnd_spy * (lp->lnd_effic / 100.0); } -double +void intelligence_report(int destination, struct lndstr *lp, int spy, char *mess) { struct lchrstr *lcp; char buf1[80], buf2[80], buf3[80]; - double estimate = 0.0; /* estimated defense value */ if (destination == 0) - return 0; + return; if (lp->lnd_own == 0) - return 0; + return; lcp = &lchr[(int)lp->lnd_type]; @@ -352,8 +351,6 @@ intelligence_report(int destination, struct lndstr *lp, int spy, else sprintf(buf1, "%s %s", mess, prland(lp)); - estimate = lp->lnd_item[I_MILIT]; - if (chance((spy + lp->lnd_vis) / 20.0)) { if (destination == player->cnum) pr(" (eff %d, mil %d", @@ -363,7 +360,6 @@ intelligence_report(int destination, struct lndstr *lp, int spy, sprintf(buf2, " (eff %d, mil %d", roundintby(lp->lnd_effic, 5), roundintby(lp->lnd_item[I_MILIT], 10)); - estimate = lp->lnd_item[I_MILIT] * lp->lnd_effic / 100.0; if (chance((spy + lp->lnd_vis) / 20.0)) { int t; @@ -390,11 +386,6 @@ intelligence_report(int destination, struct lndstr *lp, int spy, if (destination != player->cnum) { wu(0, destination, "%s%s%s", buf1, buf2, buf3); } - - if (lp->lnd_ship < 0 || lcp->l_flags & L_MARINE) - estimate *= lp->lnd_def; - - return estimate; } /* Used by the spy command to count land units in a sector. If used