]> git.pond.sub.org Git - empserver/commitdiff
Simplify breaking of command loop
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 15 Jul 2008 02:30:28 +0000 (22:30 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 15 Jul 2008 10:25:29 +0000 (06:25 -0400)
Change status() to check player->eof instead of io_error() and
io_eof().  Ignore value of command().

src/lib/player/player.c

index f6f1e34e4ba6a1f54992be03e7e9e57dcb9f3f9d..0c8a865dd2aa1eb90a634d9a48752279ad983917 100644 (file)
@@ -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)