]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/pr.c
Fix journalling of output ids
[empserver] / src / lib / subs / pr.c
index 6f2be24a22764788b8d0670aa9b6b3bc92588186..496bde49ba2901164b051a6435301d12ca34a74b 100644 (file)
@@ -56,6 +56,7 @@
 #include "com.h"
 #include "empio.h"
 #include "file.h"
+#include "journal.h"
 #include "misc.h"
 #include "nat.h"
 #include "player.h"
@@ -124,6 +125,7 @@ pr_id(struct player *p, int id, char *format, ...)
 
     if (p->curid >= 0) {
        io_puts(p->iop, "\n");
+       journal_output(p, p->curid, "\n");
        p->curid = -1;
     }
     va_start(ap, format);
@@ -245,6 +247,7 @@ pr_player(struct player *pl, int id, char *buf)
            bp += len;
        }
     }
+    journal_output(pl, id, buf);
 }
 
 /*
@@ -299,6 +302,7 @@ upr_player(struct player *pl, int id, char *buf)
            io_puts(pl->iop, printbuf);
        }
     }
+    journal_output(pl, id, buf);
 }
 
 /*
@@ -368,12 +372,6 @@ prmptrd(char *prompt, char *buf, int size)
 {
     int r;
 
-    /*
-     * Each prompt must consume one line of input.  recvclient()
-     * doesn't do that while player->aborted.
-     */
-    CANT_HAPPEN(player->aborted);
-
     if (CANT_HAPPEN(!prompt))
        prompt = "? ";
 
@@ -403,9 +401,6 @@ uprmptrd(char *prompt, char *buf, int size)
 {
     int r;
 
-    /* See prmptrd() */
-    CANT_HAPPEN(player->aborted);
-
     if (CANT_HAPPEN(!prompt))
        prompt = "? ";