aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 116b1e8688..1c40acd135 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -185,12 +185,12 @@ Common::Error MohawkEngine_Riven::run() {
while (!shouldQuit())
- handleEvents();
+ doFrame();
return Common::kNoError;
}
-void MohawkEngine_Riven::handleEvents() {
+void MohawkEngine_Riven::doFrame() {
// Update background running things
checkTimer();
_sound->updateSLST();
@@ -277,6 +277,12 @@ void MohawkEngine_Riven::handleEvents() {
_card->onMouseUpdate();
+ if (!_scriptMan->runningQueuedScripts()) {
+ // Don't run queued scripts if we are calling from a queued script
+ // otherwise infinite looping will happen.
+ _scriptMan->runQueuedScripts();
+ }
+
// Update the screen if we need to
if (needsUpdate)
_system->updateScreen();
@@ -553,6 +559,22 @@ bool MohawkEngine_Riven::isZipVisitedCard(const Common::String &hotspotName) con
return foundMatch;
}
+bool MohawkEngine_Riven::canLoadGameStateCurrently() {
+ return !(getFeatures() & GF_DEMO);
+}
+
+bool MohawkEngine_Riven::canSaveGameStateCurrently() {
+ if (getFeatures() & GF_DEMO) {
+ return false;
+ }
+
+ if (_scriptMan->hasQueuedScripts()) {
+ return false;
+ }
+
+ return true;
+}
+
bool ZipMode::operator== (const ZipMode &z) const {
return z.name == name && z.id == id;
}