This commit is contained in:
jl777
2019-02-10 03:54:53 -11:00
parent 8f9182c45e
commit ff50eb0c7c
2 changed files with 14 additions and 5 deletions

View File

@@ -161,8 +161,9 @@ readchar(struct rogue_state *rs)
rs->replaydone = (uint32_t)time(NULL); rs->replaydone = (uint32_t)time(NULL);
return(rs->keystrokes[rs->ind++]); return(rs->keystrokes[rs->ind++]);
} }
fatal("replay finished but readchar called\n"); //fatal("replay finished but readchar called\n");
return(' '); rs->replaydone = (uint32_t)time(NULL);
return(ESCAPE);
} }
if ( rs == 0 || rs->guiflag != 0 ) if ( rs == 0 || rs->guiflag != 0 )
{ {
@@ -277,10 +278,18 @@ wait_for(struct rogue_state *rs,int ch)
if (ch == '\n') if (ch == '\n')
while ((c = readchar(rs)) != '\n' && c != '\r') while ((c = readchar(rs)) != '\n' && c != '\r')
continue; {
if ( rs->replaydone != 0 )
return;
continue;
}
else else
while (readchar(rs) != ch) while (readchar(rs) != ch)
continue; {
if ( rs->replaydone != 0 )
return;
continue;
}
} }
/* /*

View File

@@ -543,7 +543,7 @@ playit(struct rogue_state *rs)
{ {
if ( rs->replaydone != 0 ) if ( rs->replaydone != 0 )
{ {
//fprintf(stderr,"replaydone\n"); sleep(3); fprintf(stderr,"replaydone\n"); sleep(3);
return; return;
} }
if ( rs->sleeptime != 0 ) if ( rs->sleeptime != 0 )