[Scummvm-git-logs] scummvm branch-2-3 -> 0bea6ae7ffdd952b67474ebefc97ca92bb8de900

orgads orgads at gmail.com
Fri Sep 10 06:27:02 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0bea6ae7ff ENGINES: Do not attempt autosave when the autosave slot is -1


Commit: 0bea6ae7ffdd952b67474ebefc97ca92bb8de900
    https://github.com/scummvm/scummvm/commit/0bea6ae7ffdd952b67474ebefc97ca92bb8de900
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-09-10T09:26:58+03:00

Commit Message:
ENGINES: Do not attempt autosave when the autosave slot is -1

Changed paths:
    engines/engine.cpp


diff --git a/engines/engine.cpp b/engines/engine.cpp
index 22dc482158..73083d1beb 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -598,6 +598,9 @@ void Engine::saveAutosaveIfEnabled() {
 	// (as is the case with the AGS engine for example, or when showing a prompt).
 	if (_autoSaving || _autosaveInterval == 0)
 		return;
+	const int autoSaveSlot = getAutosaveSlot();
+	if (autoSaveSlot < 0)
+		return;
 	_autoSaving = true;
 
 	bool saveFlag = canSaveAutosaveCurrently();
@@ -607,7 +610,7 @@ void Engine::saveAutosaveIfEnabled() {
 	if (saveFlag)
 		saveFlag = warnBeforeOverwritingAutosave();
 
-	if (saveFlag && saveGameState(getAutosaveSlot(), autoSaveName, true).getCode() != Common::kNoError) {
+	if (saveFlag && saveGameState(autoSaveSlot, autoSaveName, true).getCode() != Common::kNoError) {
 		// Couldn't autosave at the designated time
 		g_system->displayMessageOnOSD(_("Error occurred making autosave"));
 		saveFlag = false;




More information about the Scummvm-git-logs mailing list