aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-05-03 10:20:51 +0200
committerAdrian Frühwirth2018-05-10 17:51:30 +0000
commit8cb0109b40a28a24f85b3595aaac7bba79a022cf (patch)
tree5f62e67419ea12cd2febe0a7e7f67464c2acc167 /engines/scumm
parent94823479281be376e921960dbbb5410818331dd2 (diff)
downloadscummvm-rg350-8cb0109b40a28a24f85b3595aaac7bba79a022cf.tar.gz
scummvm-rg350-8cb0109b40a28a24f85b3595aaac7bba79a022cf.tar.bz2
scummvm-rg350-8cb0109b40a28a24f85b3595aaac7bba79a022cf.zip
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.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/scumm.cpp4
1 files changed, 3 insertions, 1 deletions
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();
}
}