[Scummvm-git-logs] scummvm master -> b7413e9a42ed0079dcf9c7d984311ed25de12190

orgads orgads at gmail.com
Fri Sep 10 06:26:41 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:
b7413e9a42 ENGINES: Do not attempt autosave when the autosave slot is -1


Commit: b7413e9a42ed0079dcf9c7d984311ed25de12190
    https://github.com/scummvm/scummvm/commit/b7413e9a42ed0079dcf9c7d984311ed25de12190
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-09-10T09:26:15+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 6383ef3cbd..e60769a50a 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -603,6 +603,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();
@@ -612,7 +615,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