aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/glk/glk_api.cpp3
-rw-r--r--engines/glk/scott/scott.cpp7
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp
index 609401590a..e04040f67f 100644
--- a/engines/glk/glk_api.cpp
+++ b/engines/glk/glk_api.cpp
@@ -62,7 +62,10 @@ void GlkAPI::glk_exit(void) {
glk_put_string("[ press any key to exit ]");
_events->waitForPress();
+ // Trigger a ScumMVM shutdown of game
quitGame();
+ Common::Event e;
+ g_system->getEventManager()->pollEvent(e);
}
void GlkAPI::glk_set_interrupt_handler(void(*func)(void)) {
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index cbc5886130..dc0ae0b939 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -102,6 +102,8 @@ void Scott::runGame(Common::SeekableReadStream *gameFile) {
default:
break;
}
+ if (shouldQuit())
+ return;
// Brian Howarth games seem to use -1 for forever
if (_items[LIGHT_SOURCE]._location != DESTROYED && _gameHeader._lightTime != -1) {
@@ -789,7 +791,7 @@ int Scott::performLine(int ct) {
doneit:
output("The game is now over.\n");
glk_exit();
- break;
+ return 0;
case 64:
break;
case 65: {
@@ -1022,6 +1024,9 @@ int Scott::performActions(int vb, int no) {
if (vb != 0 && doagain == 0)
return 0;
}
+
+ if (shouldQuit())
+ return 0;
}
}
ct++;