(status, init_nats): Concentrate CAP and MONEY logic in

player_set_nstat().
This commit is contained in:
Markus Armbruster 2007-12-08 20:53:08 +00:00
parent 976c885dfc
commit d3eec3e09d
2 changed files with 2 additions and 4 deletions

View file

@ -71,7 +71,7 @@ player_set_nstat(struct player *pl, struct natstr *np)
{
static int nstat[] = {
/* must match nat_status */
0, VIS, VIS, SANCT, NORM, GOD
0, VIS, VIS, SANCT, NORM, GOD | CAP | MONEY
};
if (CANT_HAPPEN(pl->cnum != np->nat_cnum))
@ -80,7 +80,7 @@ player_set_nstat(struct player *pl, struct natstr *np)
pl->nstat = nstat[np->nat_stat];
if (np->nat_money >= 0)
pl->nstat |= MONEY;
if (np->nat_stat >= STAT_ACTIVE && !influx(np))
if (np->nat_stat == STAT_ACTIVE && !influx(np))
pl->nstat |= CAP;
return pl->nstat;
}

View file

@ -173,8 +173,6 @@ status(void)
old_nstat = player->nstat;
player_set_nstat(player, natp);
if (player->god)
player->nstat |= CAP | MONEY;
if ((old_nstat & MONEY) && !(player->nstat & MONEY))
pr("You are now broke; industries are on strike.\n");
if (!(old_nstat & MONEY) && (player->nstat & MONEY))