This commit is contained in:
jl777
2019-02-17 22:38:44 -11:00
parent 7be1c55228
commit 0a11653334

View File

@@ -153,13 +153,22 @@ step_ok(int ch)
char char
readchar(struct rogue_state *rs) readchar(struct rogue_state *rs)
{ {
char ch = -1; char c,ch = -1;
if ( rs != 0 && rs->guiflag == 0 ) if ( rs != 0 && rs->guiflag == 0 )
{ {
static uint32_t counter; static uint32_t counter;
if ( rs->ind < rs->numkeys ) 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 ) if ( rs->replaydone != 0 && counter++ < 3 )
fprintf(stderr,"replay finished but readchar called\n"); fprintf(stderr,"replay finished but readchar called\n");