aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-29 15:01:12 -0700
committerPaul Gilbert2019-07-06 15:27:08 -0700
commitec979b8555cfc10cca3858df2cca635c04f240d2 (patch)
treebed01c988a4f6efbc8b4fc6fd676618df4c7b5c9 /engines/glk
parent55b93f5a20bb352b0388c8cc1802437a2fcc6ce9 (diff)
downloadscummvm-rg350-ec979b8555cfc10cca3858df2cca635c04f240d2.tar.gz
scummvm-rg350-ec979b8555cfc10cca3858df2cca635c04f240d2.tar.bz2
scummvm-rg350-ec979b8555cfc10cca3858df2cca635c04f240d2.zip
GLK: ALAN3: Fix quitting game from input line when window closed
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/alan3/readline.cpp3
-rw-r--r--engines/glk/alan3/scan.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/engines/glk/alan3/readline.cpp b/engines/glk/alan3/readline.cpp
index 2bd408f7cb..34e9e645c6 100644
--- a/engines/glk/alan3/readline.cpp
+++ b/engines/glk/alan3/readline.cpp
@@ -70,6 +70,9 @@ bool readline(char buffer[]) {
*/
do {
g_vm->glk_select(&event);
+ if (g_vm->shouldQuit())
+ return FALSE;
+
switch (event.type) {
case evtype_Arrange:
statusline();
diff --git a/engines/glk/alan3/scan.cpp b/engines/glk/alan3/scan.cpp
index 284f28f13c..6785b2a11b 100644
--- a/engines/glk/alan3/scan.cpp
+++ b/engines/glk/alan3/scan.cpp
@@ -148,6 +148,11 @@ static void getLine(CONTEXT) {
printAndLog("> ");
if (!readline(buf)) {
+ if (g_vm->shouldQuit()) {
+ context._break = true;
+ return;
+ }
+
newline();
quitGame();
}