diff options
-rw-r--r-- | engines/sci/engine/state.cpp | 17 | ||||
-rw-r--r-- | engines/sci/engine/workarounds.cpp | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index c23add1211..76df322b30 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -390,26 +390,29 @@ SciCallOrigin EngineState::getCurrentCallOrigin() const { const Script *localScript = _segMan->getScriptIfLoaded(xs->local_segment); int curScriptNr = localScript->getScriptNumber(); + Selector debugSelector = xs->debugSelector; + int debugExportId = xs->debugExportId; + if (xs->debugLocalCallOffset != -1) { // if lastcall was actually a local call search back for a real call Common::List<ExecStack>::const_iterator callIterator = _executionStack.end(); while (callIterator != _executionStack.begin()) { callIterator--; const ExecStack &loopCall = *callIterator; - if ((loopCall.debugSelector != -1) || (loopCall.debugExportId != -1)) { - xs->debugSelector = loopCall.debugSelector; - xs->debugExportId = loopCall.debugExportId; + if (loopCall.debugSelector != -1 || loopCall.debugExportId != -1) { + debugSelector = loopCall.debugSelector; + debugExportId = loopCall.debugExportId; break; } } } if (xs->type == EXEC_STACK_TYPE_CALL) { - if (xs->debugSelector != -1) { - curMethodName = g_sci->getKernel()->getSelectorName(xs->debugSelector); - } else if (xs->debugExportId != -1) { + if (debugSelector != -1) { + curMethodName = g_sci->getKernel()->getSelectorName(debugSelector); + } else if (debugExportId != -1) { curObjectName = ""; - curMethodName = Common::String::format("export %d", xs->debugExportId); + curMethodName = Common::String::format("export %d", debugExportId); } } diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 148e9e77c3..025e94ad76 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -876,7 +876,7 @@ const SciWorkaroundEntry kScrollWindowAdd_workarounds[] = { SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroundEntry *workaroundList, SciCallOrigin *trackOrigin) { const EngineState *state = g_sci->getEngineState(); - ExecStack *lastCall = state->xs; + const ExecStack *lastCall = state->xs; const SciGameId gameId = g_sci->getGameId(); *trackOrigin = state->getCurrentCallOrigin(); |