Remove columns lnd, pln from spy report to fix spy unit leak

The values in these columns were computed by count_sect_units() and
count_sect_planes(), which included land units and planes in the count
that aren't shown by prunits() and prplanes(), namely own and embarked
units.  Confusing.  Moreover, count_sect_planes() and prunits() rolled
dice separately for spy units.  This could leak the presence of spies
even when prunits() didn't show them.

All fixable, but not worth the trouble; just remove the counts.
This commit is contained in:
Markus Armbruster 2008-06-14 18:55:29 +02:00
parent c658d1e08d
commit a233ecfea9
5 changed files with 4 additions and 56 deletions

View file

@ -100,7 +100,7 @@ spy(void)
pr("SPY report\n");
prdate();
pr(" old sct rd rl def\n");
pr(" sect de own own eff eff eff eff civ mil shl gun pet food bars lnd pln\n");
pr(" sect de own own eff eff eff eff civ mil shl gun pet food bars\n");
while (nxtsct(&nstr, &from)) {
if (!player->owner && !player->god)
continue;
@ -202,7 +202,7 @@ static void
spy_report(struct sctstr *sp)
{
prxy("%4d,%-4d", sp->sct_x, sp->sct_y, player->cnum);
pr(" %c%c %3d %3d %3d %3d %3d %3d %4d %4d %4d %3d %4d %4d %4d %3d %3d\n",
pr(" %c%c %3d %3d %3d %3d %3d %3d %4d %4d %4d %3d %4d %4d %4d\n",
dchr[sp->sct_type].d_mnem,
sp->sct_newtype == sp->sct_type ? ' ' : dchr[sp->sct_newtype].d_mnem,
sp->sct_own,
@ -217,9 +217,7 @@ spy_report(struct sctstr *sp)
roundintby(sp->sct_item[I_GUN], 10),
roundintby(sp->sct_item[I_PETROL], 10),
roundintby(sp->sct_item[I_FOOD], 10),
roundintby(sp->sct_item[I_BAR], 10),
count_sect_units(sp),
count_sect_planes(sp));
roundintby(sp->sct_item[I_BAR], 10));
prunits(sp->sct_x, sp->sct_y);
prplanes(sp->sct_x, sp->sct_y);
}