(natstr): Simplify encoding of member nat_update. Users changed.
(WUPD_WANT): Unused, remove.
This commit is contained in:
parent
bd16520e7c
commit
1fa61af843
4 changed files with 4 additions and 12 deletions
|
@ -109,9 +109,6 @@ struct natstr {
|
||||||
long nat_flags; /* nation flags */
|
long nat_flags; /* nation flags */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Update fields. */
|
|
||||||
#define WUPD_WANT bit(0)
|
|
||||||
|
|
||||||
/* nstat values */
|
/* nstat values */
|
||||||
#define VIS bit(0)
|
#define VIS bit(0)
|
||||||
#define SANCT (bit(1) | VIS)
|
#define SANCT (bit(1) | VIS)
|
||||||
|
|
|
@ -63,7 +63,6 @@ zdon(void)
|
||||||
struct natstr *natp;
|
struct natstr *natp;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
int update;
|
|
||||||
int checking;
|
int checking;
|
||||||
int wantupd;
|
int wantupd;
|
||||||
int totpop;
|
int totpop;
|
||||||
|
@ -112,14 +111,12 @@ zdon(void)
|
||||||
pr("Unable to request an update as the country is in flux\n");
|
pr("Unable to request an update as the country is in flux\n");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
update = natp->nat_update | WUPD_WANT;
|
|
||||||
natp->nat_missed = 0;
|
natp->nat_missed = 0;
|
||||||
pr("You (%d) now want an update.\n", whichcnum);
|
pr("You (%d) now want an update.\n", whichcnum);
|
||||||
} else {
|
} else {
|
||||||
update = natp->nat_update & ~WUPD_WANT;
|
|
||||||
pr("You (%d) now DON'T want an update.\n", whichcnum);
|
pr("You (%d) now DON'T want an update.\n", whichcnum);
|
||||||
}
|
}
|
||||||
natp->nat_update = update;
|
natp->nat_update = wantupd;
|
||||||
putnat(natp);
|
putnat(natp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ demand_update_want(int *want, int *pop, int which)
|
||||||
/* Should probably include sanctuaries ..... */
|
/* Should probably include sanctuaries ..... */
|
||||||
if (natp->nat_stat == STAT_ACTIVE) {
|
if (natp->nat_stat == STAT_ACTIVE) {
|
||||||
totpop++;
|
totpop++;
|
||||||
if ((natp->nat_update & WUPD_WANT) == WUPD_WANT) {
|
if (natp->nat_update) {
|
||||||
totwant++;
|
totwant++;
|
||||||
if (which == cn)
|
if (which == cn)
|
||||||
whichwants++;
|
whichwants++;
|
||||||
|
|
|
@ -42,11 +42,9 @@ update_removewants(void)
|
||||||
struct natstr *natp;
|
struct natstr *natp;
|
||||||
|
|
||||||
for (cn = 0; NULL != (natp = getnatp(cn)); cn++) {
|
for (cn = 0; NULL != (natp = getnatp(cn)); cn++) {
|
||||||
if ((natp->nat_stat != STAT_UNUSED) &&
|
if (natp->nat_stat != STAT_UNUSED && !natp->nat_update)
|
||||||
(natp->nat_update & WUPD_WANT) == 0) {
|
|
||||||
natp->nat_missed++;
|
natp->nat_missed++;
|
||||||
}
|
natp->nat_update = 0;
|
||||||
natp->nat_update &= ~WUPD_WANT;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue