aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authorStrangerke2013-10-07 22:38:32 +0200
committerStrangerke2013-10-07 22:38:32 +0200
commitc36adb83e2820dd6ad0f612c5a3a05a001220656 (patch)
tree0f60b9ab592bf19a68549a1c4152b8fee3fcbced /engines/avalanche
parent7b11be0a9245875fe6cd48ffd9e3f2f325d98c23 (diff)
downloadscummvm-rg350-c36adb83e2820dd6ad0f612c5a3a05a001220656.tar.gz
scummvm-rg350-c36adb83e2820dd6ad0f612c5a3a05a001220656.tar.bz2
scummvm-rg350-c36adb83e2820dd6ad0f612c5a3a05a001220656.zip
AVALANCHE: Fix savegames list
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/detection.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index e45422192c..428e71f35a 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -117,15 +117,11 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
SaveStateList saveList;
- char slot[3];
for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
- slot[0] = filename->c_str()[filename->size() - 6];
- slot[1] = filename->c_str()[filename->size() - 5];
- slot[2] = '\0';
- // Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
- int slotNum = atoi(slot);
+ const Common::String &fname = *filename;
+ int slotNum = atoi(fname.c_str() + fname.size() - 3);
if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
- Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
+ Common::InSaveFile *file = saveFileMan->openForLoading(fname);
if (file) {
// Check for our signature.
uint32 signature = file->readUint32LE();