From 41b7f714e95f83ec23398154f2ffdf8050d44b68 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 4 Jan 2009 19:52:59 +0000 Subject: fix infinite loop when trying to quit in Winnie svn-id: r35732 --- engines/agi/preagi_winnie.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index 38e711c330..8bbe1ceb73 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -241,7 +241,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { // 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 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { opcode = 0; break; } - } while (opcode); + } while (opcode && !_vm->shouldQuit()); if (iNewRoom) { _room = iNewRoom; @@ -446,6 +446,8 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { _vm->_gfx->doUpdate(); _vm->_system->updateScreen(); } + + return IDI_WTP_PAR_OK; } void Winnie::keyHelp() { @@ -1014,6 +1016,7 @@ phase2: 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)) { -- cgit v1.2.3