diff options
author | Paul Gilbert | 2019-06-19 20:38:48 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-06-22 14:40:49 -0700 |
commit | df7465232108c15ca613db0b5e709e34378dbd8c (patch) | |
tree | d8c9167360cb13ed4e3ed15aa72189484d0aadad /engines/glk/alan2/parse.cpp | |
parent | b4ae2ec4374a8f920fa3287b6906e09c6c68f57f (diff) | |
download | scummvm-rg350-df7465232108c15ca613db0b5e709e34378dbd8c.tar.gz scummvm-rg350-df7465232108c15ca613db0b5e709e34378dbd8c.tar.bz2 scummvm-rg350-df7465232108c15ca613db0b5e709e34378dbd8c.zip |
GLK: ALAN2: Added shouldQuit checks to break out of game loops
Diffstat (limited to 'engines/glk/alan2/parse.cpp')
-rw-r--r-- | engines/glk/alan2/parse.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/glk/alan2/parse.cpp b/engines/glk/alan2/parse.cpp index 4e54c5cd6d..41a442438c 100644 --- a/engines/glk/alan2/parse.cpp +++ b/engines/glk/alan2/parse.cpp @@ -21,6 +21,7 @@ */ #include <string> +#include "glk/alan2/alan2.h" #include "glk/alan2/types.h" #ifdef USE_READLINE @@ -212,6 +213,9 @@ static void agetline() fprintf(logfil, "> "); #ifdef USE_READLINE if (!readline(buf)) { + if (g_vm->shouldQuit()) + return; + newline(); quit(); } @@ -257,6 +261,9 @@ static void scan() char *str; agetline(); + if (g_vm->shouldQuit()) + return; + wrds[0] = 0; for (i = 0; i < litCount; i++) if (litValues[i].type == TYPSTR && litValues[i].value != 0) @@ -820,6 +827,8 @@ void parse() if (wrds[wrdidx] == EOF) { wrdidx = 0; scan(); + if (g_vm->shouldQuit()) + return; } else if (anyOutput) para(); |