Skip to content

Commit

Permalink
CGE2: Let listSaves return list sorted on slot numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Feb 25, 2016
1 parent e428dfc commit 8fce4b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engines/cge2/detection.cpp
Expand Up @@ -199,7 +199,6 @@ SaveStateList CGE2MetaEngine::listSaves(const char *target) const {
pattern += ".###";

filenames = saveFileMan->listSavefiles(pattern);
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)

SaveStateList saveList;
for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
Expand Down Expand Up @@ -235,6 +234,8 @@ SaveStateList CGE2MetaEngine::listSaves(const char *target) const {
}
}

// Sort saves based on slot number.
Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
return saveList;
}

Expand Down

0 comments on commit 8fce4b5

Please sign in to comment.