aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/xeen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/xeen/xeen.cpp')
-rw-r--r--engines/xeen/xeen.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index d34e8edb21..ed944262e1 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -51,6 +51,7 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
_spells = nullptr;
_town = nullptr;
_eventData = nullptr;
+ _quitMode = 0;
_dangerSenseAllowed = false;
_noDirectionSense = false;
_moveMonsters = false;
@@ -289,6 +290,7 @@ void XeenEngine::playGame() {
*/
void XeenEngine::play() {
// TODO: Init variables
+ _quitMode = 0;
_interface->setup();
_screen->loadBackground("back.raw");
@@ -331,8 +333,8 @@ void XeenEngine::gameLoop() {
while (!shouldQuit()) {
_map->cellFlagLookup(_party->_mazePosition);
if (_map->_currentIsEvent) {
- _scripts->checkEvents();
- if (shouldQuit())
+ _quitMode = _scripts->checkEvents();
+ if (shouldQuit() || _quitMode)
return;
}
_scripts->giveTreasure();