(status): Round money before checking solvency, and consistently treat
$0 as solvent. Before, you became bankrupt / solvent when your money went below / above zero before rounding, but not when you hit zero exactly.
This commit is contained in:
parent
ab368ce23b
commit
a71ec1459d
1 changed files with 4 additions and 4 deletions
|
@ -170,17 +170,17 @@ status(void)
|
|||
pr("That just cost you $%.2f\n", player->dolcost);
|
||||
else if (player->dolcost < -100.0)
|
||||
pr("You just made $%.2f\n", -player->dolcost);
|
||||
if (natp->nat_money < player->dolcost && !player->broke) {
|
||||
natp->nat_money -= roundavg(player->dolcost);
|
||||
player->dolcost = 0.0;
|
||||
if (natp->nat_money < 0 && !player->broke) {
|
||||
player->broke = 1;
|
||||
player->nstat &= ~MONEY;
|
||||
pr("You are now broke; industries are on strike.\n");
|
||||
} else if (player->broke && natp->nat_money - player->dolcost > 0) {
|
||||
} else if (player->broke && natp->nat_money >= 0) {
|
||||
player->broke = 0;
|
||||
player->nstat |= MONEY;
|
||||
pr("You are no longer broke!\n");
|
||||
}
|
||||
natp->nat_money -= roundavg(player->dolcost);
|
||||
player->dolcost = 0.0;
|
||||
getsect(natp->nat_xcap, natp->nat_ycap, §);
|
||||
if (influx(natp))
|
||||
player->nstat &= ~CAP;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue