]> git.pond.sub.org Git - empserver/commitdiff
(natstr): Simplify encoding of member nat_update. Users changed.
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Jul 2007 17:48:57 +0000 (17:48 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Jul 2007 17:48:57 +0000 (17:48 +0000)
(WUPD_WANT): Unused, remove.

include/nat.h
src/lib/commands/zdon.c
src/lib/common/wantupd.c
src/lib/update/removewants.c

index be31d2f0976fd101cb7069298798bc16d549d473..c761ea8e2403003de181f90a3d21acb8103ef22c 100644 (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)
index c6ac37f4ee46f3d3645ebc32315cde36c7fc35ea..8a03ef587b361ab43b490101c6f4b1bcacabfad3 100644 (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);
     }
 
index e1edfbb142b5ed369ed49a2826fc8db20eca28cf..6fccaeb7b8bf1d6e4c548da19379ad50b7fe7ef9 100644 (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++;
index 66f79bb4816325cb04b3598da88024ab92c7ce2d..eecd4dcb3602e7a72cef618532b231dd849f2203 100644 (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;
 }