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

@ -58,18 +58,17 @@ flash(void)
return RET_SYN;
}
if (us->nat_stat & STAT_GOD) {
if (us->nat_stat == STAT_GOD) {
/* We are gods, we can flash anyone */
} else if (us->nat_stat == VIS) {
} else if (us->nat_stat == STAT_VIS) {
/* We are a visitor. We can only flash the gods. :) */
if (!(to->nat_stat & STAT_GOD)) {
if (to->nat_stat != STAT_GOD) {
pr("Visitors can only flash the gods.\n");
return RET_SYN;
}
} else {
/* Ok, we are a normal country, can we flash them? */
if ((!(to->nat_stat & STAT_GOD)) &&
(getrel(to, player->cnum) < FRIENDLY)) {
if (to->nat_stat != STAT_GOD && getrel(to, player->cnum) < FRIENDLY) {
pr("%s is not a deity or friendly with us.\n", to->nat_cnam);
return RET_SYN;
}