[Scummvm-git-logs] scummvm master -> fbb4cb9b319e2fecc483fe579f2a38c86aeb65f7

dreammaster dreammaster at scummvm.org
Mon Jul 3 04:03:44 CEST 2017


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:
fbb4cb9b31 TITANIC: Don't allow saving during the Doorbot prologue


Commit: fbb4cb9b319e2fecc483fe579f2a38c86aeb65f7
    https://github.com/scummvm/scummvm/commit/fbb4cb9b319e2fecc483fe579f2a38c86aeb65f7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-02T22:02:24-04:00

Commit Message:
TITANIC: Don't allow saving during the Doorbot prologue

This works around a bug in the original where if you saved immediately
after getting the PET, the savegame would put in in an invalid state

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/npcs/doorbot.cpp
    engines/titanic/titanic.cpp


diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 3286a6c..3d9fede 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 d4befa8..0c94662 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 a1534fa..58e11b0 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 ab3c961..1494a6a 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())





More information about the Scummvm-git-logs mailing list