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

dreammaster dreammaster at scummvm.org
Sun Aug 29 02:29:17 UTC 2021


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:
f30705ae45 CRUISE: Don't allow saving during the endgame sequence


Commit: f30705ae4511d2ea25fc40d6040d823ee804b0ec
    https://github.com/scummvm/scummvm/commit/f30705ae4511d2ea25fc40d6040d823ee804b0ec
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-28T19:28:38-07:00

Commit Message:
CRUISE: Don't allow saving during the endgame sequence

Changed paths:
    engines/cruise/background.cpp
    engines/cruise/cruise.cpp
    engines/cruise/cruise.h
    engines/cruise/menu.cpp


diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 4aa33cffd5..5943f153b7 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -21,8 +21,8 @@
  */
 
 #include "common/textconsole.h"
-
 #include "cruise/cruise_main.h"
+#include "cruise/cruise.h"
 
 namespace Cruise {
 
@@ -90,6 +90,12 @@ int loadBackground(const char *name, int idx) {
 
 	debug(1, "Loading BG: %s", name);
 
+	// WORKAROUND: Don't allow save/loading during endgame
+	if (!strcmp(name, "DGF1.PI1")) {
+		_vm->_isEndGame = true;
+		userEnabled = false;
+	}
+
 	if (!backgroundScreens[idx]) {
 		backgroundScreens[idx] = (uint8 *)mallocAndZero(320 * 200);
 	}
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp
index 39ce2df251..7e40921a51 100644
--- a/engines/cruise/cruise.cpp
+++ b/engines/cruise/cruise.cpp
@@ -55,6 +55,7 @@ CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc
 	_speedFlag = false;
 	_polyStructs = nullptr;
 	_polyStruct = nullptr;
+	_isEndGame = false;
 
 	// Setup mixer
 	syncSoundSettings();
@@ -210,7 +211,7 @@ Common::Error CruiseEngine::saveGameState(int slot, const Common::String &desc,
 }
 
 bool CruiseEngine::canSaveGameStateCurrently() {
-	return (playerMenuEnabled != 0) && (userEnabled != 0);
+	return (playerMenuEnabled != 0) && (userEnabled != 0) && !_isEndGame;
 }
 
 const char *CruiseEngine::getSavegameFile(int saveGameIdx) {
diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h
index 16a4324072..09ce98ca7f 100644
--- a/engines/cruise/cruise.h
+++ b/engines/cruise/cruise.h
@@ -103,6 +103,7 @@ public:
 	void initAllData();
 
 	Common::RandomSource _rnd;
+	bool _isEndGame;
 
 	struct MemInfo {
 		int32  lineNum;
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index 295eef4d48..55592cb772 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -183,6 +183,8 @@ int processMenu(menuStruct *pMenu) {
 
 		manageEvents();
 		g_system->delayMillis(10);
+		if (_vm->shouldQuit())
+			return -1;
 
 //    readKeyboard();
 	} while (!si);




More information about the Scummvm-git-logs mailing list