summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/cio.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/cio.cc')
-rw-r--r--crawl-ref/source/cio.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc
index 4296b65654..bc9909c29b 100644
--- a/crawl-ref/source/cio.cc
+++ b/crawl-ref/source/cio.cc
@@ -108,6 +108,19 @@ void get_input_line( char *const buff, int len )
{
buff[0] = 0; // just in case
+ if (crawl_state.is_replaying_keys())
+ {
+ ASSERT(crawl_state.input_line_curr <
+ crawl_state.input_line_strs.size());
+
+ unsigned int curr = crawl_state.input_line_curr++;
+ std::string &line = crawl_state.input_line_strs[curr];
+
+ strcpy(buff, line.c_str());
+
+ return;
+ }
+
#if defined(UNIX)
get_input_line_from_curses( buff, len ); // implemented in libunix.cc
#elif defined(WIN32CONSOLE)
@@ -137,6 +150,8 @@ void get_input_line( char *const buff, int len )
else
break;
}
+
+ crawl_state.input_line_strs.push_back(buff);
}
// Hacky wrapper around getch() that returns CK_ codes for keys