Consistently consider a nation bankrupt when its treasury is

negative.  Some places considered $0 as bankrupt, some didn't.  Fix
the ones that did:
(repo_list): report command misreported countries with $0 as broke.
(init_nats): If you had $0, logging out and back in bankrupted you.
(produce_sect, upd_ship): Failed to build sectors and produce stuff
for countries with $0.
This commit is contained in:
Markus Armbruster 2007-12-08 14:46:40 +00:00
parent a71ec1459d
commit 09a842c1a0
4 changed files with 6 additions and 6 deletions

View file

@ -97,7 +97,7 @@ repo_list(struct natstr *plnatp, struct natstr *natp)
} else { } else {
if (!opt_HIDDEN && influx(natp)) if (!opt_HIDDEN && influx(natp))
pr("In flux\n"); pr("In flux\n");
else if (!opt_HIDDEN && natp->nat_money <= 0) else if (!opt_HIDDEN && natp->nat_money < 0)
pr("Broke\n"); pr("Broke\n");
else else
pr("Active\n"); pr("Active\n");

View file

@ -63,7 +63,7 @@ init_nats(void)
if (opt_HIDDEN) { if (opt_HIDDEN) {
putcontact(np, player->cnum, FOUND_SPY); putcontact(np, player->cnum, FOUND_SPY);
} }
if (np->nat_money <= 0) if (np->nat_money < 0)
player->broke = 1; player->broke = 1;
else { else {
player->nstat |= MONEY; player->nstat |= MONEY;

View file

@ -327,7 +327,7 @@ produce_sect(int natnum, int etu, struct bp *bp, long p_sect[][2])
desig = sp->sct_type; desig = sp->sct_type;
if ((sp->sct_effic < 100 || sp->sct_type != sp->sct_newtype) && if ((sp->sct_effic < 100 || sp->sct_type != sp->sct_newtype) &&
np->nat_money > 0) { np->nat_money >= 0) {
neweff = upd_buildeff(np, sp, &work, vec, etu, &desig, sctwork, neweff = upd_buildeff(np, sp, &work, vec, etu, &desig, sctwork,
&cost); &cost);
bp_put_items(bp, sp, vec); bp_put_items(bp, sp, vec);
@ -354,7 +354,7 @@ produce_sect(int natnum, int etu, struct bp *bp, long p_sect[][2])
*/ */
if (neweff >= 60) { if (neweff >= 60) {
if (np->nat_money > 0 && dchr[desig].d_prd >= 0) if (np->nat_money >= 0 && dchr[desig].d_prd >= 0)
work -= produce(np, sp, vec, work, desig, neweff, work -= produce(np, sp, vec, work, desig, neweff,
&pcost, &amount); &pcost, &amount);
bp_put_items(bp, sp, vec); bp_put_items(bp, sp, vec);

View file

@ -156,7 +156,7 @@ upd_ship(struct shpstr *sp, int etus,
sectp = getsectp(sp->shp_x, sp->shp_y); sectp = getsectp(sp->shp_x, sp->shp_y);
/* produce oil */ /* produce oil */
if (np->nat_money > 0 if (np->nat_money >= 0
&& (mp->m_flags & M_OIL) && sectp->sct_type == SCT_WATER) { && (mp->m_flags & M_OIL) && sectp->sct_type == SCT_WATER) {
product = &pchr[dchr[SCT_OIL].d_prd]; product = &pchr[dchr[SCT_OIL].d_prd];
oil_gained = roundavg(total_work(100, etus, oil_gained = roundavg(total_work(100, etus,
@ -182,7 +182,7 @@ upd_ship(struct shpstr *sp, int etus,
sp->shp_item[I_OIL] += oil_gained; sp->shp_item[I_OIL] += oil_gained;
} }
/* produce fish */ /* produce fish */
if (np->nat_money > 0 if (np->nat_money >= 0
&& (mp->m_flags & M_FOOD) && sectp->sct_type == SCT_WATER) { && (mp->m_flags & M_FOOD) && sectp->sct_type == SCT_WATER) {
sp->shp_item[I_FOOD] sp->shp_item[I_FOOD]
+= roundavg(total_work(100, etus, += roundavg(total_work(100, etus,