[Scummvm-cvs-logs] scummvm master -> 77db46ad339d6a4f0ad2d02217c103051565006c

bluegr md5 at scummvm.org
Fri Apr 29 15:15:32 CEST 2011


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:
77db46ad33 TSAGE: Fixed saved game ordering in the save and load dialogs


Commit: 77db46ad339d6a4f0ad2d02217c103051565006c
    https://github.com/scummvm/scummvm/commit/77db46ad339d6a4f0ad2d02217c103051565006c
Author: md5 (md5 at scummvm.org)
Date: 2011-04-29T06:14:07-07:00

Commit Message:
TSAGE: Fixed saved game ordering in the save and load dialogs

Changed paths:
    engines/tsage/detection.cpp



diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp
index 5d34037..ba7b459 100644
--- a/engines/tsage/detection.cpp
+++ b/engines/tsage/detection.cpp
@@ -126,16 +126,18 @@ public:
 
 	virtual SaveStateList listSaves(const char *target) const {
 		Common::String pattern = target;
-		pattern += ".*";
+		pattern += ".???";
 
 		Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern);
+		sort(filenames.begin(), filenames.end());
 		tSage::tSageSavegameHeader header;
 
 		SaveStateList saveList;
 		for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
-			int slot;
 			const char *ext = strrchr(file->c_str(), '.');
-			if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) {
+			int slot = ext ? atoi(ext + 1) : -1;
+
+			if (slot >= 0 && slot < MAX_SAVES) {
 				Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
 
 				if (in) {






More information about the Scummvm-git-logs mailing list