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

bluegr noreply at scummvm.org
Sat Dec 11 19:01:10 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:
e96a72ae87 ENGINES: Fix listSaves for 3-digit savegame patterns


Commit: e96a72ae876806e55f37b48436020b34333a2c92
    https://github.com/scummvm/scummvm/commit/e96a72ae876806e55f37b48436020b34333a2c92
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-12-11T21:01:06+02:00

Commit Message:
ENGINES: Fix listSaves for 3-digit savegame patterns

Changed paths:
    engines/metaengine.cpp


diff --git a/engines/metaengine.cpp b/engines/metaengine.cpp
index de1bfc4397..bbdbf7373f 100644
--- a/engines/metaengine.cpp
+++ b/engines/metaengine.cpp
@@ -333,8 +333,12 @@ SaveStateList MetaEngine::listSaves(const char *target) const {
 
 	SaveStateList saveList;
 	for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
-		// Obtain the last 2 digits of the filename, since they correspond to the save slot
-		int slotNum = atoi(file->c_str() + file->size() - 2);
+		// Obtain the last 2/3 digits of the filename, since they correspond to the save slot
+		const char *slotStr = file->c_str() + file->size() - 2;
+		const char *prev = slotStr - 1;
+		if (*prev >= '0' && *prev <= '9')
+			slotStr = prev;
+		int slotNum = atoi(slotStr);
 
 		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
 			SaveStateDescriptor desc = querySaveMetaInfos(target, slotNum);




More information about the Scummvm-git-logs mailing list