(natstr): Simplify encoding of member nat_update. Users changed.

(WUPD_WANT): Unused, remove.
This commit is contained in:
Markus Armbruster 2007-07-10 17:48:57 +00:00
parent bd16520e7c
commit 1fa61af843
4 changed files with 4 additions and 12 deletions

View file

@ -109,9 +109,6 @@ struct natstr {
long nat_flags; /* nation flags */
};
/* Update fields. */
#define WUPD_WANT bit(0)
/* nstat values */
#define VIS bit(0)
#define SANCT (bit(1) | VIS)

View file

@ -63,7 +63,6 @@ zdon(void)
struct natstr *natp;
char *p;
int update;
int checking;
int wantupd;
int totpop;
@ -112,14 +111,12 @@ zdon(void)
pr("Unable to request an update as the country is in flux\n");
return RET_FAIL;
}
update = natp->nat_update | WUPD_WANT;
natp->nat_missed = 0;
pr("You (%d) now want an update.\n", whichcnum);
} else {
update = natp->nat_update & ~WUPD_WANT;
pr("You (%d) now DON'T want an update.\n", whichcnum);
}
natp->nat_update = update;
natp->nat_update = wantupd;
putnat(natp);
}

View file

@ -132,7 +132,7 @@ demand_update_want(int *want, int *pop, int which)
/* Should probably include sanctuaries ..... */
if (natp->nat_stat == STAT_ACTIVE) {
totpop++;
if ((natp->nat_update & WUPD_WANT) == WUPD_WANT) {
if (natp->nat_update) {
totwant++;
if (which == cn)
whichwants++;

View file

@ -42,11 +42,9 @@ update_removewants(void)
struct natstr *natp;
for (cn = 0; NULL != (natp = getnatp(cn)); cn++) {
if ((natp->nat_stat != STAT_UNUSED) &&
(natp->nat_update & WUPD_WANT) == 0) {
if (natp->nat_stat != STAT_UNUSED && !natp->nat_update)
natp->nat_missed++;
}
natp->nat_update &= ~WUPD_WANT;
natp->nat_update = 0;
}
return 0;
}