From: Markus Armbruster Date: Sat, 28 Jan 2012 14:34:25 +0000 (+0100) Subject: Show treasury status on EOF, quit, shutdown X-Git-Tag: v4.3.30~68 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=bdc1c40f0a92bc568d41ba9b79d32e0f93ebb1f3 Show treasury status on EOF, quit, shutdown status() informs the player of non-trivial command costs and earnings, and when he goes broke or becomes solvent. However, this is skipped when the command gets aborted by the player signalling EOF, or by server shutdown, and after a quit command. Fix by moving the check for EOF or shutdown down to the may_play_now() check. This looks a bit like it would also fix charging of play time. But that's not broken, because player_main() charges, too. --- diff --git a/src/lib/player/player.c b/src/lib/player/player.c index 6d8571d8a..c770c5538 100644 --- a/src/lib/player/player.c +++ b/src/lib/player/player.c @@ -145,8 +145,6 @@ status(void) int old_nstat; char buf[128]; - if (player->eof || player->state == PS_SHUTDOWN) - return 0; natp = getnatp(player->cnum); if (player->dolcost > 100.0) pr("That just cost you $%.2f\n", player->dolcost); @@ -173,8 +171,10 @@ status(void) time(&player->curup); update_timeused(player->curup); - if (!may_play_now(natp, player->curup)) + if (player->eof || player->state == PS_SHUTDOWN + || !may_play_now(natp, player->curup)) return 0; + if (player->btused) { natp->nat_btu -= player->btused; player->btused = 0;