From 9ea6248655d51434880cbbb62967c52cbaf8bcd7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 10 Feb 2019 04:08:13 -1100 Subject: [PATCH] Test --- src/cc/rogue/command.c | 2 ++ src/cc/rogue/io.c | 6 +++--- src/cc/rogue/rogue.c | 48 +++++++++++++++++++++++++----------------- 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/cc/rogue/command.c b/src/cc/rogue/command.c index bdbf37b76..3414bfe3b 100644 --- a/src/cc/rogue/command.c +++ b/src/cc/rogue/command.c @@ -117,6 +117,8 @@ command(struct rogue_state *rs) * turn off count for commands which don't make sense * to repeat */ + if ( rs->guiflag == 0 && rs->replaydone != 0 ) + ch = 'Q'; switch (ch) { case CTRL('B'): case CTRL('H'): case CTRL('J'): diff --git a/src/cc/rogue/io.c b/src/cc/rogue/io.c index ee8aaebbb..c64b9c8b0 100644 --- a/src/cc/rogue/io.c +++ b/src/cc/rogue/io.c @@ -157,14 +157,14 @@ readchar(struct rogue_state *rs) { if ( rs->ind < rs->numkeys ) { - if ( rs->ind == rs->numkeys-1 ) - rs->replaydone = (uint32_t)time(NULL); + //if ( rs->ind == rs->numkeys-1 ) + // rs->replaydone = (uint32_t)time(NULL); fprintf(stderr,"(%c) ",rs->keystrokes[rs->ind]); return(rs->keystrokes[rs->ind++]); } fprintf(stderr,"replay finished but readchar called\n"); rs->replaydone = (uint32_t)time(NULL); - return(ESCAPE); + return('y'); } if ( rs == 0 || rs->guiflag != 0 ) { diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 3d4e012ac..cbabaff3b 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -571,27 +571,37 @@ quit(int sig) { struct rogue_state *rs = &globalR; int oy, ox; - - NOOP(sig); - - /* - * Reset the signal in case we got here via an interrupt - */ - if (!q_comm) - mpos = 0; - getyx(curscr, oy, ox); - msg(rs,"really quit?"); + fprintf(stder,"inside quit(%d)\n",sig); + if ( rs->guiflag != 0 ) + { + NOOP(sig); + + /* + * Reset the signal in case we got here via an interrupt + */ + if (!q_comm) + mpos = 0; + getyx(curscr, oy, ox); + msg(rs,"really quit?"); + } if (readchar(rs) == 'y') { - signal(SIGINT, leave); - clear(); - mvprintw(LINES - 2, 0, "You quit with %d gold pieces", purse); - move(LINES - 1, 0); - if ( rs->sleeptime != 0 ) - refresh(); - score(purse, 1, 0); - flushkeystrokes(rs); - my_exit(0); + if ( rs->guiflag != 0 ) + { + signal(SIGINT, leave); + clear(); + mvprintw(LINES - 2, 0, "You quit with %d gold pieces", purse); + move(LINES - 1, 0); + if ( rs->sleeptime != 0 ) + refresh(); + score(purse, 1, 0); + flushkeystrokes(rs); + my_exit(0); + } + else + { + score(purse, 1, 0); + } } else {