Check if we should quit on every opcode call instead of after every 500. Fixes bug #2960238.

svn-id: r48149
This commit is contained in:
Matthew Hoops 2010-02-27 18:54:21 +00:00
parent 22e5a557b7
commit eda17df00c

View File

@ -145,7 +145,7 @@ void ScriptInterpreter::runScript(int16 scriptObjectIndex) {
_codeBase = _vm->_dat->getObject(_runningScriptObjectIndex)->getData();
_codeIp = _codeBase;
while (true) {
while (!_vm->shouldQuit()) {
byte opcode = readByte();
if (opcode >= 1 && opcode <= _commandsMax) {
@ -160,9 +160,6 @@ void ScriptInterpreter::runScript(int16 scriptObjectIndex) {
if (++opcodeSleepCounter > 500) {
_vm->_screen->updateScreenAndWait(5);
opcodeSleepCounter = 0;
if (_vm->shouldQuit()) {
break;
}
}
}