aboutsummaryrefslogtreecommitdiff
path: root/engines/gargoyle
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gargoyle')
-rw-r--r--engines/gargoyle/events.cpp4
-rw-r--r--engines/gargoyle/scott/scott.cpp11
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/gargoyle/events.cpp b/engines/gargoyle/events.cpp
index b1f1823276..bba9df1c56 100644
--- a/engines/gargoyle/events.cpp
+++ b/engines/gargoyle/events.cpp
@@ -31,7 +31,6 @@ void Events::getEvent(event_t *event, bool polled) {
_currentEvent = event;
event->clear();
- Common::Event ev;
dispatchEvent(*_currentEvent, polled);
if (!polled) {
@@ -41,6 +40,9 @@ void Events::getEvent(event_t *event, bool polled) {
dispatchEvent(*_currentEvent, polled);
}
+
+ if (g_vm->shouldQuit())
+ _currentEvent->type = evtype_Quit;
}
if (_currentEvent->type == evtype_None && _timeouts) {
diff --git a/engines/gargoyle/scott/scott.cpp b/engines/gargoyle/scott/scott.cpp
index d533a7ea44..381239299c 100644
--- a/engines/gargoyle/scott/scott.cpp
+++ b/engines/gargoyle/scott/scott.cpp
@@ -92,6 +92,9 @@ Distributed under the GNU software license\n\n");
if (GetInput(&vb, &no) == -1)
continue;
+ if (g_vm->shouldQuit())
+ return;
+
switch (PerformActions(vb, no)) {
case -1:
Output("I don't understand your command. ");
@@ -567,8 +570,9 @@ void Scott::LineInput(char *buf, size_t n) {
do {
glk_select(&ev);
-
- if (ev.type == evtype_LineInput)
+ if (ev.type == evtype_Quit)
+ return;
+ else if (ev.type == evtype_LineInput)
break;
else if (ev.type == evtype_Arrange && split_screen)
Look();
@@ -654,6 +658,9 @@ int Scott::GetInput(int *vb, int *no) {
do {
Output("\nTell me what to do ? ");
LineInput(buf, sizeof buf);
+ if (g_vm->shouldQuit())
+ return 0;
+
num = sscanf(buf, "%9s %9s", verb, noun);
} while (num == 0 || *buf == '\n');