[Scummvm-cvs-logs] SF.net SVN: scummvm:[35732] scummvm/trunk/engines/agi/preagi_winnie.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Sun Jan 4 20:53:00 CET 2009


Revision: 35732
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35732&view=rev
Author:   mthreepwood
Date:     2009-01-04 19:52:59 +0000 (Sun, 04 Jan 2009)

Log Message:
-----------
fix infinite loop when trying to quit in Winnie

Modified Paths:
--------------
    scummvm/trunk/engines/agi/preagi_winnie.cpp

Modified: scummvm/trunk/engines/agi/preagi_winnie.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_winnie.cpp	2009-01-04 19:37:56 UTC (rev 35731)
+++ scummvm/trunk/engines/agi/preagi_winnie.cpp	2009-01-04 19:52:59 UTC (rev 35732)
@@ -241,7 +241,7 @@
 	// extract header from buffer
 	parseRoomHeader(&hdr, buffer, sizeof(WTP_ROOM_HDR));
 
-	for (;;) {
+	while (!_vm->shouldQuit()) {
 		pc = startpc;
 
 		// check if block is to be run
@@ -434,7 +434,7 @@
 				opcode = 0;
 				break;
 			}
-		} while (opcode);
+		} while (opcode && !_vm->shouldQuit());
 
 		if (iNewRoom) {
 			_room = iNewRoom;
@@ -446,6 +446,8 @@
 		_vm->_gfx->doUpdate();
 		_vm->_system->updateScreen();
 	}
+	
+	return IDI_WTP_PAR_OK;
 }
 
 void Winnie::keyHelp() {
@@ -1014,6 +1016,7 @@
 		if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK)
 			goto phase1;
 	}
+	
 	while (!_vm->shouldQuit()) {
 		for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {
 			switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) {


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