From: Markus Armbruster Date: Tue, 15 Jul 2008 02:30:28 +0000 (-0400) Subject: Simplify breaking of command loop X-Git-Tag: v4.3.16~73 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=9c5854c8c93979c1744c97c90df672070e080a99 Simplify breaking of command loop Change status() to check player->eof instead of io_error() and io_eof(). Ignore value of command(). --- diff --git a/src/lib/player/player.c b/src/lib/player/player.c index f6f1e34e4..0c8a865dd 100644 --- a/src/lib/player/player.c +++ b/src/lib/player/player.c @@ -110,8 +110,7 @@ player_main(struct player *p) } while (status()) { - if (command() == 0 && !player->aborted) - break; + command(); player->aborted = 0; empth_yield(); } @@ -157,13 +156,9 @@ status(void) int old_nstat, minute; char buf[128]; - if (player->state == PS_SHUTDOWN) + if (player->eof || player->state == PS_SHUTDOWN) return 0; natp = getnatp(player->cnum); - if (io_error(player->iop) || io_eof(player->iop)) { - putnat(natp); - return 0; - } if (player->dolcost > 100.0) pr("That just cost you $%.2f\n", player->dolcost); else if (player->dolcost < -100.0)