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
This commit is contained in:
Filippos Karapetis 2010-06-21 20:17:59 +00:00
parent 38b172e8e5
commit 97dd94019c

View File

@ -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