From ec979b8555cfc10cca3858df2cca635c04f240d2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 29 Jun 2019 15:01:12 -0700 Subject: GLK: ALAN3: Fix quitting game from input line when window closed --- engines/glk/alan3/readline.cpp | 3 +++ engines/glk/alan3/scan.cpp | 5 +++++ 2 files changed, 8 insertions(+) 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(); } -- cgit v1.2.3