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]
This commit is contained in:
parent
ca717aeca4
commit
572b3a5f4a
2 changed files with 2 additions and 6 deletions
|
@ -86,11 +86,7 @@ void SaveStateDescriptor::setAutosave(bool autosave) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SaveStateDescriptor::isAutosave() const {
|
bool SaveStateDescriptor::isAutosave() const {
|
||||||
if (_saveType != kSaveTypeUndetermined) {
|
return hasAutoSaveName() || _saveType == kSaveTypeAutosave;
|
||||||
return _saveType == kSaveTypeAutosave;
|
|
||||||
} else {
|
|
||||||
return hasAutosaveName();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SaveStateDescriptor::hasAutosaveName() const
|
bool SaveStateDescriptor::hasAutosaveName() const
|
||||||
|
|
|
@ -2688,7 +2688,7 @@ bool GlobalOptionsDialog::updateAutosavePeriod(int newValue) {
|
||||||
if (autoSaveSlot < 0)
|
if (autoSaveSlot < 0)
|
||||||
continue;
|
continue;
|
||||||
SaveStateDescriptor desc = metaEngine.querySaveMetaInfos(target.c_str(), autoSaveSlot);
|
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) {
|
if (saveList.size() >= maxListSize) {
|
||||||
hasMore = true;
|
hasMore = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue