aboutsummaryrefslogtreecommitdiff
path: root/engines/wage/wage.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2017-08-29 09:33:14 +0200
committerEugene Sandulenko2017-08-29 09:33:44 +0200
commitb5c552b3bb7f6cd18c493dc23b678135c86a12e7 (patch)
tree13b61bfc26f5120117aaf4d6d3a421cca3e84236 /engines/wage/wage.cpp
parent58fb345b3e56feb6f05bee0385e115f47bc00b81 (diff)
downloadscummvm-rg350-b5c552b3bb7f6cd18c493dc23b678135c86a12e7.tar.gz
scummvm-rg350-b5c552b3bb7f6cd18c493dc23b678135c86a12e7.tar.bz2
scummvm-rg350-b5c552b3bb7f6cd18c493dc23b678135c86a12e7.zip
WAGE: Quit gracefully when requested
Diffstat (limited to 'engines/wage/wage.cpp')
-rw-r--r--engines/wage/wage.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index 7f9fb073f5..ce47e3ebea 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -123,6 +123,8 @@ Common::Error WageEngine::run() {
if (!_world->loadWorld(_resManager))
return Common::kNoGameDataFoundError;
+ _shouldQuit = false;
+
_gui = new Gui(this);
_temporarilyHidden = true;
@@ -140,8 +142,6 @@ Common::Error WageEngine::run() {
processTurn(&input, NULL);
_temporarilyHidden = false;
- _shouldQuit = false;
-
while (!_shouldQuit) {
_debugger->onFrame();
@@ -445,6 +445,10 @@ void WageEngine::processTurnInternal(Common::String *textInput, Designed *clickI
regen();
Common::String input("look");
processTurnInternal(&input, NULL);
+
+ if (_shouldQuit)
+ return;
+
redrawScene();
_temporarilyHidden = false;
} else if (_loopCount == 1) {