mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 00:35:54 +00:00
Prevent a crash when the engine errors out before the game state is initialized
svn-id: r42201
This commit is contained in:
parent
0a8cd4a27d
commit
2e3419c8cb
@ -201,12 +201,14 @@ Console::~Console() {
|
||||
}
|
||||
|
||||
void Console::preEnter() {
|
||||
_vm->_gamestate->_sound.sfx_suspend(true);
|
||||
if (_vm->_gamestate)
|
||||
_vm->_gamestate->_sound.sfx_suspend(true);
|
||||
_vm->_mixer->pauseAll(true);
|
||||
}
|
||||
|
||||
void Console::postEnter() {
|
||||
_vm->_gamestate->_sound.sfx_suspend(false);
|
||||
if (_vm->_gamestate)
|
||||
_vm->_gamestate->_sound.sfx_suspend(false);
|
||||
_vm->_mixer->pauseAll(false);
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,8 @@ SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc)
|
||||
Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
|
||||
Common::addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
|
||||
|
||||
_gamestate = 0;
|
||||
|
||||
printf("SciEngine::SciEngine\n");
|
||||
}
|
||||
|
||||
@ -251,11 +253,14 @@ Common::Error SciEngine::run() {
|
||||
|
||||
// Invoked by error() when a severe error occurs
|
||||
GUI::Debugger *SciEngine::getDebugger() {
|
||||
ExecStack *xs = &(_gamestate->_executionStack.back());
|
||||
if (_gamestate) {
|
||||
ExecStack *xs = &(_gamestate->_executionStack.back());
|
||||
xs->addr.pc.offset = debugState.old_pc_offset;
|
||||
xs->sp = debugState.old_sp;
|
||||
}
|
||||
|
||||
debugState.runningStep = 0; // Stop multiple execution
|
||||
debugState.seeking = kDebugSeekNothing; // Stop special seeks
|
||||
xs->addr.pc.offset = debugState.old_pc_offset;
|
||||
xs->sp = debugState.old_sp;
|
||||
|
||||
return _console;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user