mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 07:53:12 +00:00
SCI: Hopefully fix bug #3565505 - "SCI : crash when loading a savegame"
This bug occurs because in the cases specified in the bug report, the main loop hasn't run fully yet, and there is a mini loop running instead (e.g. inside Print()) Hopefully, this catches most cases where the crash occurs, but it needs more testing to find if there is any other such case.
This commit is contained in:
parent
b91a132763
commit
76ff4c7001
@ -834,12 +834,16 @@ Common::Error SciEngine::saveGameState(int slot, const Common::String &desc) {
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
// Before enabling the load option in the ScummVM menu, the main game loop must
|
||||
// have run at least once. When the game loop runs, kGameIsRestarting is invoked,
|
||||
// thus the speed throttler is initialized. Hopefully fixes bug #3565505.
|
||||
|
||||
bool SciEngine::canLoadGameStateCurrently() {
|
||||
return !_gamestate->executionStackBase;
|
||||
return !_gamestate->executionStackBase && (_gamestate->_throttleLastTime > 0 || _gamestate->_throttleTrigger);
|
||||
}
|
||||
|
||||
bool SciEngine::canSaveGameStateCurrently() {
|
||||
return !_gamestate->executionStackBase;
|
||||
return !_gamestate->executionStackBase && (_gamestate->_throttleLastTime > 0 || _gamestate->_throttleTrigger);
|
||||
}
|
||||
|
||||
} // End of namespace Sci
|
||||
|
Loading…
x
Reference in New Issue
Block a user