aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-12-08 22:35:33 -0500
committerPaul Gilbert2016-12-08 22:35:33 -0500
commit301ab51735cf8c8aac88a3df7e3f8d87b4122bc7 (patch)
treef5c3a37de9641e99845dc695bb365a65b333ab5a
parent42af800adbbf72242506be22637b08420fa32ff0 (diff)
downloadscummvm-rg350-301ab51735cf8c8aac88a3df7e3f8d87b4122bc7.tar.gz
scummvm-rg350-301ab51735cf8c8aac88a3df7e3f8d87b4122bc7.tar.bz2
scummvm-rg350-301ab51735cf8c8aac88a3df7e3f8d87b4122bc7.zip
TITANIC: Don't allow GMM Loading/Saving if the PET area is locked
-rw-r--r--engines/titanic/pet_control/pet_control.cpp6
-rw-r--r--engines/titanic/pet_control/pet_control.h2
-rw-r--r--engines/titanic/titanic.cpp14
3 files changed, 16 insertions, 6 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 423f87cd8c..b7fece7569 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -212,7 +212,7 @@ void CPetControl::resetActiveNPC() {
}
PetArea CPetControl::setArea(PetArea newArea, bool forceChange) {
- if ((!forceChange && newArea == _currentArea) || !isAreaActive())
+ if ((!forceChange && newArea == _currentArea) || !isAreaUnlocked())
return _currentArea;
// Signal the currently active area that it's being left
@@ -271,7 +271,7 @@ bool CPetControl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
return false;
bool result = false;
- if (isAreaActive())
+ if (isAreaUnlocked())
result = _frame.MouseButtonDownMsg(msg);
if (!result) {
@@ -302,7 +302,7 @@ bool CPetControl::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
return false;
bool result = false;
- if (isAreaActive())
+ if (isAreaUnlocked())
result = _frame.MouseButtonUpMsg(msg);
if (!result)
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 34d1330b52..af5ceb0a2a 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -354,7 +354,7 @@ public:
/**
* Returns true if the PET is currently unlocked
*/
- bool isAreaActive() const { return _areaLockCount == 0; }
+ bool isAreaUnlocked() const { return _areaLockCount == 0; }
/**
* Increment the number of PET area (tab) locks
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index e80dc54bcb..48feab5aa4 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -41,6 +41,7 @@
#include "titanic/moves/enter_exit_first_class_state.h"
#include "titanic/moves/enter_exit_sec_class_mini_lift.h"
#include "titanic/moves/exit_pellerator.h"
+#include "titanic/pet_control/pet_control.h"
#include "titanic/support/simple_file.h"
#include "titanic/true_talk/tt_npc_script.h"
@@ -169,11 +170,20 @@ void TitanicEngine::setRoomNames() {
bool TitanicEngine::canLoadGameStateCurrently() {
- return _window->_inputAllowed;
+ if (!_window->_inputAllowed)
+ return false;
+ CProjectItem *project = _window->_gameManager->_project;
+ if (project) {
+ CPetControl *pet = project->getPetControl();
+ if (pet && !pet->isAreaUnlocked())
+ return false;
+ }
+
+ return true;
}
bool TitanicEngine::canSaveGameStateCurrently() {
- return _window->_inputAllowed;
+ return canLoadGameStateCurrently();
}
Common::Error TitanicEngine::loadGameState(int slot) {