Change nation status from bits to a simple enum:

(nat_status, STAT_UNUSED, STAT_VIS, STAT_ACTIVE): New.
(STAT_NEW, STAT_SANCT, STAT_GOD): Change into nat_status members.
(STAT_INUSE, STAT_NORM): Remove.
(natstr): Use new nat_status for nat_stat.
    New value       Old value
    STAT_UNUSED     0
    STAT_NEW        STAT_INUSE | STAT_NEW
    STAT_VIS        STAT_INUSE
    STAT_SANCT      STAT_INUSE | STAT_SANCT
    STAT_ACTIVE     STAT_INUSE | STAT_NORM
    STAT_GOD        STAT_INUSE | STAT_NORM | STAT_GOD
Users changed.
This commit is contained in:
Markus Armbruster 2006-01-04 22:49:42 +00:00
parent 41c2c27376
commit 8b16c31223
35 changed files with 113 additions and 151 deletions

View file

@ -90,15 +90,11 @@ rejectname(struct natstr *np, natid other)
char *
natstate(struct natstr *np)
{
if ((np->nat_stat & STAT_INUSE) == 0)
return "FREE";
if (np->nat_stat & STAT_GOD)
return "DEITY";
if (np->nat_stat & STAT_SANCT)
return "SANCTUARY";
if ((np->nat_stat & STAT_NORM) == 0)
return "VISITOR";
return "ACTIVE";
static char *stnam[] = {
/* must match nat_status */
"FREE", "VISITOR", "VISITOR", "SANCTUARY", "ACTIVE", "DEITY"
};
return stnam[np->nat_stat];
}
/* This returns the relations that np has with them */