[Scummvm-git-logs] scummvm master -> 572b3a5f4a66ac971ef71100765eb1bbddc003f3

bluegr noreply at scummvm.org
Mon Oct 24 23:37:06 UTC 2022


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:
572b3a5f4a ENGINES: Properly identify the autosave file


Commit: 572b3a5f4a66ac971ef71100765eb1bbddc003f3
    https://github.com/scummvm/scummvm/commit/572b3a5f4a66ac971ef71100765eb1bbddc003f3
Author: macca8 (brugenerol at tpg.com.au)
Date: 2022-10-25T02:37:01+03:00

Commit Message:
ENGINES: Properly identify the autosave file

Restructure isAutosave() function:
- Prioritize name test
- Access saveType test only if name test fails
Performs both tests when required, resolving false positives unique to each test, and ensures that only saves which fail both tests appear in autosave warning dialogs.

Properly fixes [https://bugs.scummvm.org/ticket/12363 #12363], refer [https://bugs.scummvm.org/ticket/13842 #13842]

Changed paths:
    engines/savestate.cpp
    gui/options.cpp


diff --git a/engines/savestate.cpp b/engines/savestate.cpp
index 6da9200be83..98f2f4f8b42 100644
--- a/engines/savestate.cpp
+++ b/engines/savestate.cpp
@@ -86,11 +86,7 @@ void SaveStateDescriptor::setAutosave(bool autosave) {
 }
 
 bool SaveStateDescriptor::isAutosave() const {
-	if (_saveType != kSaveTypeUndetermined) {
-		return _saveType == kSaveTypeAutosave;
-	} else {
-		return hasAutosaveName();
-	}
+	return hasAutoSaveName() || _saveType == kSaveTypeAutosave;
 }
 
 bool SaveStateDescriptor::hasAutosaveName() const
diff --git a/gui/options.cpp b/gui/options.cpp
index 1a48e0f7eb8..a48c9cb70fa 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2688,7 +2688,7 @@ bool GlobalOptionsDialog::updateAutosavePeriod(int newValue) {
 				if (autoSaveSlot < 0)
 					continue;
 				SaveStateDescriptor desc = metaEngine.querySaveMetaInfos(target.c_str(), autoSaveSlot);
-				if (desc.getSaveSlot() != -1 && !desc.getDescription().empty() && !desc.hasAutosaveName()) {
+				if (desc.getSaveSlot() != -1 && !desc.getDescription().empty() && !desc.isAutosave()) {
 					if (saveList.size() >= maxListSize) {
 						hasMore = true;
 						break;




More information about the Scummvm-git-logs mailing list