[Scummvm-cvs-logs] scummvm master -> cb01dd36b62fca7b8bcd8d41d701f6f41b8249d8

lukaslw lukaslw at gmail.com
Sun Nov 9 02:45:10 CET 2014


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:
cb01dd36b6 PRINCE: canLoadGameStateCurrently() - to check if loading is allowed


Commit: cb01dd36b62fca7b8bcd8d41d701f6f41b8249d8
    https://github.com/scummvm/scummvm/commit/cb01dd36b62fca7b8bcd8d41d701f6f41b8249d8
Author: lukaslw (lukaslw at gmail.com)
Date: 2014-11-09T02:42:48+01:00

Commit Message:
PRINCE: canLoadGameStateCurrently() - to check if loading is allowed

Also block saving during dialogbox and inventory drawing

Changed paths:
    engines/prince/saveload.cpp



diff --git a/engines/prince/saveload.cpp b/engines/prince/saveload.cpp
index 65983f4..46e598b 100644
--- a/engines/prince/saveload.cpp
+++ b/engines/prince/saveload.cpp
@@ -177,7 +177,10 @@ bool PrinceEngine::canSaveGameStateCurrently() {
 		if (_mainHero->_visible) {
 			// 29 - Basement
 			if (_locationNr != 29) {
-				return true;
+				// No dialog box and not in inventory
+				if (!_dialogFlag && !_showInventoryFlag) {
+					return true;
+				}
 			}
 		}
 	}
@@ -185,8 +188,18 @@ bool PrinceEngine::canSaveGameStateCurrently() {
 }
 
 bool PrinceEngine::canLoadGameStateCurrently() {
-	// Always true
-	return true;
+	if (_mouseFlag && _mouseFlag != 3) {
+		if (_mainHero->_visible) {
+			// 29 - Basement
+			if (_locationNr != 29) {
+				// No dialog box and not in inventory
+				if (!_dialogFlag && !_showInventoryFlag) {
+					return true;
+				}
+			}
+		}
+	}
+	return false;
 }
 
 Common::Error PrinceEngine::saveGameState(int slot, const Common::String &desc) {
@@ -512,9 +525,6 @@ bool PrinceEngine::loadGame(int slotNumber) {
 	syncGame(readStream, nullptr);
 	delete readStream;
 
-	// TODO
-	//syncSpeechSettings();
-
 	return true;
 }
 






More information about the Scummvm-git-logs mailing list