[Scummvm-git-logs] scummvm master -> 301ab51735cf8c8aac88a3df7e3f8d87b4122bc7
dreammaster
dreammaster at scummvm.org
Fri Dec 9 04:35:41 CET 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
301ab51735 TITANIC: Don't allow GMM Loading/Saving if the PET area is locked
Commit: 301ab51735cf8c8aac88a3df7e3f8d87b4122bc7
https://github.com/scummvm/scummvm/commit/301ab51735cf8c8aac88a3df7e3f8d87b4122bc7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-12-08T22:35:33-05:00
Commit Message:
TITANIC: Don't allow GMM Loading/Saving if the PET area is locked
Changed paths:
engines/titanic/pet_control/pet_control.cpp
engines/titanic/pet_control/pet_control.h
engines/titanic/titanic.cpp
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 423f87c..b7fece7 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 34d1330..af5ceb0 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 e80dc54..48feab5 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) {
More information about the Scummvm-git-logs
mailing list