(status, init_nats): Concentrate CAP and MONEY logic in
player_set_nstat().
This commit is contained in:
parent
976c885dfc
commit
d3eec3e09d
2 changed files with 2 additions and 4 deletions
|
@ -71,7 +71,7 @@ player_set_nstat(struct player *pl, struct natstr *np)
|
||||||
{
|
{
|
||||||
static int nstat[] = {
|
static int nstat[] = {
|
||||||
/* must match nat_status */
|
/* 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))
|
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];
|
pl->nstat = nstat[np->nat_stat];
|
||||||
if (np->nat_money >= 0)
|
if (np->nat_money >= 0)
|
||||||
pl->nstat |= MONEY;
|
pl->nstat |= MONEY;
|
||||||
if (np->nat_stat >= STAT_ACTIVE && !influx(np))
|
if (np->nat_stat == STAT_ACTIVE && !influx(np))
|
||||||
pl->nstat |= CAP;
|
pl->nstat |= CAP;
|
||||||
return pl->nstat;
|
return pl->nstat;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,8 +173,6 @@ status(void)
|
||||||
|
|
||||||
old_nstat = player->nstat;
|
old_nstat = player->nstat;
|
||||||
player_set_nstat(player, natp);
|
player_set_nstat(player, natp);
|
||||||
if (player->god)
|
|
||||||
player->nstat |= CAP | MONEY;
|
|
||||||
if ((old_nstat & MONEY) && !(player->nstat & MONEY))
|
if ((old_nstat & MONEY) && !(player->nstat & MONEY))
|
||||||
pr("You are now broke; industries are on strike.\n");
|
pr("You are now broke; industries are on strike.\n");
|
||||||
if (!(old_nstat & MONEY) && (player->nstat & MONEY))
|
if (!(old_nstat & MONEY) && (player->nstat & MONEY))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue