aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan2/parse.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-19 20:38:48 -0700
committerPaul Gilbert2019-06-22 14:40:49 -0700
commitdf7465232108c15ca613db0b5e709e34378dbd8c (patch)
treed8c9167360cb13ed4e3ed15aa72189484d0aadad /engines/glk/alan2/parse.cpp
parentb4ae2ec4374a8f920fa3287b6906e09c6c68f57f (diff)
downloadscummvm-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.cpp9
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();