From 7e1dc617c4bd23707bce447fcfe66ad51be745c5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 7 Dec 2016 19:03:08 +0100 Subject: FULLPIPE: Implement isSaveAllowed() --- engines/fullpipe/fullpipe.cpp | 14 ++++++++++++++ engines/fullpipe/fullpipe.h | 1 + 2 files changed, 15 insertions(+) diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 8a9b323761..162dff39c9 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -603,5 +603,19 @@ void FullpipeEngine::disableSaves(ExCommand *ex) { } } +bool FullpipeEngine::isSaveAllowed() { + if (!g_fp->_isSaveAllowed) + return false; + + bool allowed = true; + + for (Common::Array::iterator s = g_fp->_globalMessageQueueList->begin(); s != g_fp->_globalMessageQueueList->end(); ++s) { + if (!(*s)->_isFinished && ((*s)->getFlags() & 1)) + allowed = false; + } + + return allowed; +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index f6a8e00219..41769baab9 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -235,6 +235,7 @@ public: void enableSaves() { _isSaveAllowed = true; } void disableSaves(ExCommand *ex); + bool isSaveAllowed(); void initObjectStates(); void setLevelStates(); -- cgit v1.2.3