Simplify breaking of command loop
Change status() to check player->eof instead of io_error() and io_eof(). Ignore value of command().
This commit is contained in:
parent
b7153d095c
commit
9c5854c8c9
1 changed files with 2 additions and 7 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue