Simplify breaking of command loop

Change status() to check player->eof instead of io_error() and
io_eof().  Ignore value of command().
(cherry picked from commit 9c5854c8c9)
This commit is contained in:
Markus Armbruster 2008-07-14 22:30:28 -04:00
parent 3c3912420b
commit 80b57b2f95

View file

@ -110,8 +110,7 @@ player_main(struct player *p)
} }
while (status()) { while (status()) {
if (command() == 0 && !player->aborted) command();
break;
player->aborted = 0; player->aborted = 0;
empth_yield(); empth_yield();
} }
@ -157,13 +156,9 @@ status(void)
int old_nstat, minute; int old_nstat, minute;
char buf[128]; char buf[128];
if (player->state == PS_SHUTDOWN) if (player->eof || player->state == PS_SHUTDOWN)
return 0; return 0;
natp = getnatp(player->cnum); natp = getnatp(player->cnum);
if (io_error(player->iop) || io_eof(player->iop)) {
putnat(natp);
return 0;
}
if (player->dolcost > 100.0) if (player->dolcost > 100.0)
pr("That just cost you $%.2f\n", player->dolcost); pr("That just cost you $%.2f\n", player->dolcost);
else if (player->dolcost < -100.0) else if (player->dolcost < -100.0)