diff options
author | md5 | 2011-04-29 16:14:07 +0300 |
---|---|---|
committer | md5 | 2011-04-29 16:14:07 +0300 |
commit | 77db46ad339d6a4f0ad2d02217c103051565006c (patch) | |
tree | b2948b6a6cbacf0822e85473e7a8a69a89db7684 /engines | |
parent | 35d44737ac37f71a9e973e4d3d3dc14651050b7f (diff) | |
download | scummvm-rg350-77db46ad339d6a4f0ad2d02217c103051565006c.tar.gz scummvm-rg350-77db46ad339d6a4f0ad2d02217c103051565006c.tar.bz2 scummvm-rg350-77db46ad339d6a4f0ad2d02217c103051565006c.zip |
TSAGE: Fixed saved game ordering in the save and load dialogs
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/detection.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 5d34037b7b..ba7b459304 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) { |