diff options
author | Matthew Hoops | 2009-01-04 19:52:59 +0000 |
---|---|---|
committer | Matthew Hoops | 2009-01-04 19:52:59 +0000 |
commit | 41b7f714e95f83ec23398154f2ffdf8050d44b68 (patch) | |
tree | 976be4474bc69f5af636bac3ad6da366c3b7fdf2 | |
parent | 78a6d9e3885884444f1e4eea5d2fba6658047626 (diff) | |
download | scummvm-rg350-41b7f714e95f83ec23398154f2ffdf8050d44b68.tar.gz scummvm-rg350-41b7f714e95f83ec23398154f2ffdf8050d44b68.tar.bz2 scummvm-rg350-41b7f714e95f83ec23398154f2ffdf8050d44b68.zip |
fix infinite loop when trying to quit in Winnie
svn-id: r35732
-rw-r--r-- | engines/agi/preagi_winnie.cpp | 7 |
1 files 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)) { |