[Scummvm-cvs-logs] scummvm master -> 76ff4c700166d69b416dae324ee616ab57265c34

bluegr bluegr at gmail.com
Sat Oct 13 20:07:49 CEST 2012


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:
76ff4c7001 SCI: Hopefully fix bug #3565505 - "SCI : crash when loading a savegame"


Commit: 76ff4c700166d69b416dae324ee616ab57265c34
    https://github.com/scummvm/scummvm/commit/76ff4c700166d69b416dae324ee616ab57265c34
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-10-13T11:06:02-07:00

Commit Message:
SCI: Hopefully fix bug #3565505 - "SCI : crash when loading a savegame"

This bug occurs because in the cases specified in the bug report, the main
loop hasn't run fully yet, and there is a mini loop running instead (e.g.
inside Print())
Hopefully, this catches most cases where the crash occurs, but it needs more
testing to find if there is any other such case.

Changed paths:
    engines/sci/detection.cpp



diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 58ac5f1..8695d97 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -834,12 +834,16 @@ Common::Error SciEngine::saveGameState(int slot, const Common::String &desc) {
 	return Common::kNoError;
 }
 
+// Before enabling the load option in the ScummVM menu, the main game loop must
+// have run at least once. When the game loop runs, kGameIsRestarting is invoked,
+// thus the speed throttler is initialized. Hopefully fixes bug #3565505.
+
 bool SciEngine::canLoadGameStateCurrently() {
-	return !_gamestate->executionStackBase;
+	return !_gamestate->executionStackBase && (_gamestate->_throttleLastTime > 0 || _gamestate->_throttleTrigger);
 }
 
 bool SciEngine::canSaveGameStateCurrently() {
-	return !_gamestate->executionStackBase;
+	return !_gamestate->executionStackBase && (_gamestate->_throttleLastTime > 0 || _gamestate->_throttleTrigger);
 }
 
 } // End of namespace Sci






More information about the Scummvm-git-logs mailing list