[Scummvm-cvs-logs] SF.net SVN: scummvm:[38584] scummvm/branches/branch-0-13-0/engines/saga

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Fri Feb 20 12:52:16 CET 2009


Revision: 38584
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38584&view=rev
Author:   Kirben
Date:     2009-02-20 11:52:16 +0000 (Fri, 20 Feb 2009)

Log Message:
-----------
Backport fix for a nasty regression from the script system rewrite (commit #35670), which will cause crashes under certain conditions, and probably makes SAGA games non-completable. 

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/engines/saga/script.cpp
    scummvm/branches/branch-0-13-0/engines/saga/sthread.cpp

Modified: scummvm/branches/branch-0-13-0/engines/saga/script.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/saga/script.cpp	2009-02-20 11:45:06 UTC (rev 38583)
+++ scummvm/branches/branch-0-13-0/engines/saga/script.cpp	2009-02-20 11:52:16 UTC (rev 38584)
@@ -619,12 +619,14 @@
 
 	if (scriptFunction == &Saga::Script::sfScriptGotoScene) {
 		stopParsing = true; // cause abortAllThreads called and _this_ thread destroyed
+		breakOut = true;
 		return;
 	}
 
 #ifdef ENABLE_IHNM
 	if (scriptFunction == &Saga::Script::sfVsetTrack) {
 		stopParsing = true;
+		breakOut = true;
 		return;		// cause abortAllThreads called and _this_ thread destroyed
 	}
 #endif
@@ -666,12 +668,14 @@
 	
 	if (scriptFunction == &Saga::Script::sfScriptGotoScene) {
 		stopParsing = true;
+		breakOut = true;
 		return;		// cause abortAllThreads called and _this_ thread destroyed
 	}
 
 #ifdef ENABLE_IHNM
 	if (scriptFunction == &Saga::Script::sfVsetTrack) {
 		stopParsing = true;
+		breakOut = true;
 		return;		// cause abortAllThreads called and _this_ thread destroyed
 	}
 #endif
@@ -696,6 +700,7 @@
 	if (thread->pushedSize() == 0) {
 		thread->_flags |= kTFlagFinished;
 		stopParsing = true;
+		breakOut = true;
 		return;
 	} else {
 		thread->pop(); //cause it 0
@@ -717,6 +722,7 @@
 	if (thread->pushedSize() == 0) {
 		thread->_flags |= kTFlagFinished;
 		stopParsing = true;
+		breakOut = true;
 		return;
 	} else {
 		thread->pop(); //cause it 0
@@ -959,7 +965,8 @@
 void Script::opSpeak(SCRIPTOP_PARAMS) {
 	if (_vm->_actor->isSpeaking()) {
 		thread->wait(kWaitTypeSpeech);
-		stopParsing = false;
+		stopParsing = true;
+		breakOut = false;
 		return;
 	}
 
@@ -1012,7 +1019,8 @@
 void Script::opDialogBegin(SCRIPTOP_PARAMS) {
 	if (_conversingThread) {
 		thread->wait(kWaitTypeDialogBegin);
-		stopParsing = false;
+		stopParsing = true;
+		breakOut = false;
 		return;
 	}
 	_conversingThread = thread;
@@ -1024,7 +1032,8 @@
 		_vm->_interface->activate();
 		_vm->_interface->setMode(kPanelConverse);
 		thread->wait(kWaitTypeDialogEnd);
-		stopParsing = false;
+		stopParsing = true;
+		breakOut = false;
 		return;
 	}
 }

Modified: scummvm/branches/branch-0-13-0/engines/saga/sthread.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/saga/sthread.cpp	2009-02-20 11:45:06 UTC (rev 38583)
+++ scummvm/branches/branch-0-13-0/engines/saga/sthread.cpp	2009-02-20 11:52:16 UTC (rev 38584)
@@ -213,10 +213,10 @@
 		debug(8, "Executing thread offset: %u (%x) stack: %d", thread->_instructionOffset, operandChar, thread->pushedSize());
 
 		stopParsing = false;
+		debug(4, "Calling op %s", this->_scriptOpsList[operandChar].scriptOpName);
 		(this->*_scriptOpsList[operandChar].scriptOp)(thread, &scriptS, stopParsing, breakOut);
-		debug(4, "Calling op %s", this->_scriptOpsList[operandChar].scriptOpName);
 		if (stopParsing)
-			return true;
+			return breakOut;
 
 		if (thread->_flags & (kTFlagFinished | kTFlagAborted)) {
 			error("Wrong flags %d in thread", thread->_flags);


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