diff --git a/include/player.h b/include/player.h index ede5ad72..766de640 100644 --- a/include/player.h +++ b/include/player.h @@ -75,7 +75,6 @@ struct player { int nstat; int simulation; /* e.g. budget command */ double dolcost; - int broke; time_t curup; /* when last input was received */ int aborted; /* interrupt cookie received? */ int eof; /* EOF (cookie or real) received? */ diff --git a/src/lib/player/init_nats.c b/src/lib/player/init_nats.c index d522c27c..bb27b1fd 100644 --- a/src/lib/player/init_nats.c +++ b/src/lib/player/init_nats.c @@ -78,8 +78,7 @@ player_set_nstat(struct player *pl, struct natstr *np) return pl->nstat; pl->god = np->nat_stat == STAT_GOD; pl->nstat = nstat[np->nat_stat]; - pl->broke = np->nat_money < 0; - if (!pl->broke) + if (np->nat_money >= 0) pl->nstat |= MONEY; if (np->nat_stat >= STAT_ACTIVE && !influx(np)) pl->nstat |= CAP; diff --git a/src/lib/player/player.c b/src/lib/player/player.c index 52a7e2ba..6212dae6 100644 --- a/src/lib/player/player.c +++ b/src/lib/player/player.c @@ -154,7 +154,7 @@ static int status(void) { struct natstr *natp; - int minute; + int old_nstat, minute; char buf[128]; if (player->state == PS_SHUTDOWN) @@ -171,12 +171,12 @@ status(void) natp->nat_money -= roundavg(player->dolcost); player->dolcost = 0.0; - if (natp->nat_money < 0 && !player->broke) { - pr("You are now broke; industries are on strike.\n"); - } else if (player->broke && natp->nat_money >= 0) { - pr("You are no longer broke!\n"); - } + old_nstat = player->nstat; player_set_nstat(player, natp); + if ((old_nstat & MONEY) && !(player->nstat & MONEY)) + pr("You are now broke; industries are on strike.\n"); + if (!(old_nstat & MONEY) && (player->nstat & MONEY)) + pr("You are no longer broke!\n"); player->ncomstat = player->nstat; if (player->god) player->ncomstat |= CAP | MONEY;