aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2016-02-25 19:55:14 +0100
committerJohannes Schickel2016-02-25 21:39:45 +0100
commit0b93e1b0047497018125bcef98ac03e38d91ec26 (patch)
tree387b1af7bc79c9bb421ae829bcd8ad622fe8d05c
parentd740bc4f2e6d3ef40b0c66dd998c3a27d4589658 (diff)
downloadscummvm-rg350-0b93e1b0047497018125bcef98ac03e38d91ec26.tar.gz
scummvm-rg350-0b93e1b0047497018125bcef98ac03e38d91ec26.tar.bz2
scummvm-rg350-0b93e1b0047497018125bcef98ac03e38d91ec26.zip
SWORD2: Let listSaves return list sorted on slot numbers.
-rw-r--r--engines/sword2/sword2.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index baedecb52f..44371bf6cf 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -234,7 +234,6 @@ SaveStateList Sword2MetaEngine::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 file = filenames.begin(); file != filenames.end(); ++file) {
@@ -252,6 +251,8 @@ SaveStateList Sword2MetaEngine::listSaves(const char *target) const {
}
}
+ // Sort saves based on slot number.
+ Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
return saveList;
}