aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/game_object.cpp12
-rw-r--r--engines/titanic/core/game_object.h10
-rw-r--r--engines/titanic/npcs/doorbot.cpp2
-rw-r--r--engines/titanic/titanic.cpp5
4 files changed, 27 insertions, 2 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 3286a6c7ee..3d9fede6c1 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -589,6 +589,18 @@ void CGameObject::petHide() {
}
}
+void CGameObject::petIncAreaLocks() {
+ CPetControl *pet = getPetControl();
+ if (pet)
+ pet->incAreaLocks();
+}
+
+void CGameObject::petDecAreaLocks() {
+ CPetControl *pet = getPetControl();
+ if (pet)
+ pet->decAreaLocks();
+}
+
void CGameObject::petSetRemoteTarget() {
CPetControl *pet = getPetControl();
if (pet)
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index d4befa8fc8..0c946623ac 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -934,6 +934,16 @@ public:
void petShow();
/**
+ * Increment the number of PET area (tab) locks
+ */
+ void petIncAreaLocks();
+
+ /**
+ * Decrement the number of PET area (tab) locks
+ */
+ void petDecAreaLocks();
+
+ /**
* Shows the text cursor in the current section, if applicable
*/
void petShowCursor();
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
index a1534fa673..58e11b05ef 100644
--- a/engines/titanic/npcs/doorbot.cpp
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -95,6 +95,7 @@ bool CDoorbot::MovieEndMsg(CMovieEndMsg *msg) {
case 6:
if (clipExistsByEnd("Cloak On", msg->_endFrame)) {
petShow();
+ petDecAreaLocks();
stateSetSoundMakerAllowed(true);
changeView("ServiceElevator.Node 1.S");
changeView("ServiceElevator.Node 1.N");
@@ -444,6 +445,7 @@ bool CDoorbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg)
case 10560:
petShow();
petSetArea(PET_CONVERSATION);
+ petIncAreaLocks();
stopAnimTimer(_timerId);
_timerId = addTimer(1, 1000, 0);
break;
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index ab3c96104b..1494a6a6a2 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -176,9 +176,10 @@ void TitanicEngine::setRoomNames() {
}
bool TitanicEngine::canLoadGameStateCurrently() {
- if (!_window->_inputAllowed)
+ CGameManager *gameManager = _window->_gameManager;
+ if (!_window->_inputAllowed || !gameManager->_gameState._petActive)
return false;
- CProjectItem *project = _window->_gameManager->_project;
+ CProjectItem *project = gameManager->_project;
if (project) {
CPetControl *pet = project->getPetControl();
if (pet && !pet->isAreaUnlocked())