diff --git a/src/cc/rogue/io.c b/src/cc/rogue/io.c index 79eadb571..525550e67 100644 --- a/src/cc/rogue/io.c +++ b/src/cc/rogue/io.c @@ -153,13 +153,22 @@ step_ok(int ch) char readchar(struct rogue_state *rs) { - char ch = -1; + char c,ch = -1; if ( rs != 0 && rs->guiflag == 0 ) { static uint32_t counter; if ( rs->ind < rs->numkeys ) { - return(rs->keystrokes[rs->ind++]); + c = rs->keystrokes[rs->ind++]; + while ( c == 'Q' && rs->ind < rs->numkeys ) + { + fprintf(stderr,"Got 'Q' next (%c)\n",rs->keystrokes[rs->ind]); sleep(2); + if ( rs->keystrokes[rs->ind] == 'y' ) + return(c); + rs->ind++; + c = rs->keystrokes[rs->ind++]; + } + return(c); } if ( rs->replaydone != 0 && counter++ < 3 ) fprintf(stderr,"replay finished but readchar called\n");