TUCKER: Try autosaving only once per autosave interval

This commit is contained in:
Adrian Frühwirth 2018-04-21 15:45:34 +02:00
parent 828da1fc20
commit 2bbed8146f

View file

@ -286,13 +286,16 @@ bool TuckerEngine::isAutosaveAllowed(const char *target) {
void TuckerEngine::writeAutosave() {
if (canSaveGameStateCurrently()) {
// unconditionally reset last autosave timestamp so we don't start
// hammering the disk in case we can't/don't actually write the file
_lastSaveTime = _system->getMillis();
if (!isAutosaveAllowed()) {
warning("Refusing to overwrite non-autosave savegame in slot %i, skipping autosave", kAutoSaveSlot);
return;
}
writeSavegame(kAutoSaveSlot, "Autosave", true);
_lastSaveTime = _system->getMillis();
}
}