From 9c5854c8c93979c1744c97c90df672070e080a99 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 14 Jul 2008 22:30:28 -0400 Subject: [PATCH] Simplify breaking of command loop Change status() to check player->eof instead of io_error() and io_eof(). Ignore value of command(). --- src/lib/player/player.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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) -- 2.43.0