diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 4 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 1 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 2 |
5 files changed, 7 insertions, 4 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 05b8296b86..a64e81fcc9 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1781,7 +1781,7 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init do { int dataVal1 = _vm->_script->handleOpcode(ptr + 20 * dataOffset); - if (_vm->shouldQuit()) + if (dataVal1 == -1 || _vm->shouldQuit()) return; if (dataVal1 == 2) diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index adf7580e6b..f557723fe6 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -1923,7 +1923,6 @@ void HopkinsEngine::bombExplosion() { } void HopkinsEngine::restoreSystem() { - quitGame(); _events->refreshEvents(); } @@ -2913,4 +2912,7 @@ bool HopkinsEngine::isUnderwaterSubScene() { return (_globals->_curRoomNum >= 77) && (_globals->_curRoomNum <= 89); } +bool HopkinsEngine::shouldQuit() { + return getEventManager()->shouldQuit() || getEventManager()->shouldRTL(); +} } // End of namespace Hopkins diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index b7c6a9b5a9..7961607db7 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -168,6 +168,7 @@ public: uint16 getVersion() const; bool getIsDemo() const; const Common::String &getTargetName() const; + bool shouldQuit(); int getRandomNumber(int maxNumber); Common::String generateSaveName(int slotNumber); diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index f2f547557f..347a6aabe8 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -2629,7 +2629,7 @@ void ObjectsManager::loadObjectIniFile() { for (;;) { int opcodeType = _vm->_script->handleOpcode(data + 20 * lastOpcodeResult); - if (_vm->shouldQuit()) + if (opcodeType == -1 || _vm->shouldQuit()) return; if (opcodeType == 2) diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index d218dd27b5..c80ea15554 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -825,7 +825,7 @@ void TalkManager::handleAnswer(int zone, int verb) { int lastOpcodeResult = 1; do { int opcodeType = _vm->_script->handleOpcode(ptr + 20 * lastOpcodeResult); - if (_vm->shouldQuit()) + if (opcodeType == -1 || _vm->shouldQuit()) return; if (opcodeType == 2) |