aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-17 21:41:15 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit41a437816999c913f30f3ef2c1c751f646399c91 (patch)
tree26809d73851f630eb3e1096ddd2d5c0613248ddc /engines
parent88b0e5d52fa26f64b089f1b8d406ada46434e6d3 (diff)
downloadscummvm-rg350-41a437816999c913f30f3ef2c1c751f646399c91.tar.gz
scummvm-rg350-41a437816999c913f30f3ef2c1c751f646399c91.tar.bz2
scummvm-rg350-41a437816999c913f30f3ef2c1c751f646399c91.zip
GLK: SCOTT: Don't show another line prompt when game is exiting
Diffstat (limited to 'engines')
-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++;