[Scummvm-cvs-logs] SF.net SVN: scummvm:[51140] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Jul 22 14:38:48 CEST 2010
Revision: 51140
http://scummvm.svn.sourceforge.net/scummvm/?rev=51140&view=rev
Author: thebluegr
Date: 2010-07-22 12:38:48 +0000 (Thu, 22 Jul 2010)
Log Message:
-----------
SCI: Fixed a bug when loading some saved games (sometimes, the execution stack wasn't cleared properly when loading and you couldn't save or restore)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/engine/vm.cpp
scummvm/trunk/engines/sci/sci.cpp
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2010-07-22 12:36:58 UTC (rev 51139)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2010-07-22 12:38:48 UTC (rev 51140)
@@ -805,7 +805,6 @@
s->_msgState = new MessageState(s->_segMan);
s->abortScriptProcessing = kAbortLoadGame;
- s->shrinkStackToBase();
}
bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata *meta) {
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2010-07-22 12:36:58 UTC (rev 51139)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2010-07-22 12:38:48 UTC (rev 51140)
@@ -934,9 +934,7 @@
if (!local_script)
error("run_vm(): program counter gone astray (local_script pointer is null)");
- // TODO: Revise this
- if (s->abortScriptProcessing != kAbortLoadGame)
- s->executionStackBase = s->_executionStack.size() - 1;
+ s->executionStackBase = s->_executionStack.size() - 1;
s->variablesSegment[VAR_TEMP] = s->variablesSegment[VAR_PARAM] = s->_segMan->findSegmentByType(SEG_TYPE_STACK);
s->variablesBase[VAR_TEMP] = s->variablesBase[VAR_PARAM] = s->stack_base;
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2010-07-22 12:36:58 UTC (rev 51139)
+++ scummvm/trunk/engines/sci/sci.cpp 2010-07-22 12:38:48 UTC (rev 51140)
@@ -414,13 +414,16 @@
exitGame();
if (_gamestate->abortScriptProcessing == kAbortRestartGame) {
+ _gamestate->abortScriptProcessing = kAbortNone;
_gamestate->_segMan->resetSegMan();
initGame();
initStackBaseWithSelector(SELECTOR(play));
_gamestate->gameWasRestarted = true;
} else if (_gamestate->abortScriptProcessing == kAbortLoadGame) {
_gamestate->abortScriptProcessing = kAbortNone;
+ _gamestate->_executionStack.clear();
initStackBaseWithSelector(SELECTOR(replay));
+ _gamestate->shrinkStackToBase();
} else {
break; // exit loop
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list