From 8cb0109b40a28a24f85b3595aaac7bba79a022cf Mon Sep 17 00:00:00 2001 From: Adrian Frühwirth Date: Thu, 3 May 2018 10:20:51 +0200 Subject: SCUMM: Improve autosave handling v5+ scripts can request saving/loading of savegames, this type of savegame is internally called a "temporary" savegame (_saveStateTemporary == true) which is invisible to the user (I'm not sure whether this is by design or not). Currently the savegame handling in scummLoop_handleSaveLoad() doesn't distinguish between such temporary savegames and normal autosaves and unconditionally resets _lastSaveTime (even after loading). This has the unwanted side effect of potentially delaying the creation of normal autosaves which are supposed to be created in accordance with the autosave period setting in the GUI. This commit makes sure that _lastSaveTime only gets updated if and only if saving a (non-temporary) autosave. --- engines/scumm/scumm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index fc64df4a1a..2f6ea489d5 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2435,6 +2435,9 @@ void ScummEngine::scummLoop_handleSaveLoad() { if (success && _saveTemporaryState && VAR_GAME_LOADED != 0xFF && _game.version <= 7) VAR(VAR_GAME_LOADED) = 201; + + if (!_saveTemporaryState) + _lastSaveTime = _system->getMillis(); } else { success = loadState(_saveLoadSlot, _saveTemporaryState, filename); if (!success) @@ -2458,7 +2461,6 @@ void ScummEngine::scummLoop_handleSaveLoad() { clearClickedStatus(); _saveLoadFlag = 0; - _lastSaveTime = _system->getMillis(); } } -- cgit v1.2.3