diff options
author | Filippos Karapetis | 2010-06-21 20:17:59 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-21 20:17:59 +0000 |
commit | 97dd94019cc668342ea52603891d706f3fbab5e3 (patch) | |
tree | 437b7efb14afb6514ada4def7f4fe38825ee7f65 | |
parent | 38b172e8e5339c867fe66c69d9ef70d26c20ebf3 (diff) | |
download | scummvm-rg350-97dd94019cc668342ea52603891d706f3fbab5e3.tar.gz scummvm-rg350-97dd94019cc668342ea52603891d706f3fbab5e3.tar.bz2 scummvm-rg350-97dd94019cc668342ea52603891d706f3fbab5e3.zip |
When loading or restarting, stop script processing if the game is being loaded or is restarting and the stack position has changed (it's always changed when loading) - fixes the case where the VM is trying to parse an invalid script
svn-id: r50121
-rw-r--r-- | engines/sci/engine/vm.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 7f2ed436e8..cc7f1a1be6 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -773,6 +773,9 @@ void run_vm(EngineState *s, bool restoring) { g_debugState.old_pc_offset = s->xs->addr.pc.offset; g_debugState.old_sp = s->xs->sp; + if (s->abortScriptProcessing != kAbortNone || g_engine->shouldQuit()) + return; // Stop processing + if (s->_executionStackPosChanged) { Script *scr; s->xs = &(s->_executionStack.back()); @@ -829,7 +832,7 @@ void run_vm(EngineState *s, bool restoring) { } if (s->abortScriptProcessing != kAbortNone || g_engine->shouldQuit()) - return; // Emergency + return; // Stop processing // Debug if this has been requested: // TODO: re-implement sci_debug_flags |