From df7465232108c15ca613db0b5e709e34378dbd8c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 19 Jun 2019 20:38:48 -0700 Subject: GLK: ALAN2: Added shouldQuit checks to break out of game loops --- engines/glk/alan2/parse.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/glk/alan2/parse.cpp') 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 +#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(); -- cgit v1.2.3