Skip to content

Commit

Permalink
SKY: Only request actual save slots in listSaves.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Jan 26, 2016
1 parent add6c99 commit 0a670db
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions engines/sky/detection.cpp
Expand Up @@ -222,7 +222,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {

// Find all saves
Common::StringArray filenames;
filenames = saveFileMan->listSavefiles("SKY-VM.???");
filenames = saveFileMan->listSavefiles("SKY-VM.###");
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)

// Slot 0 is the autosave, if it exists.
Expand All @@ -235,13 +235,11 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
// Extract the extension
Common::String ext = file->c_str() + file->size() - 3;
ext.toUppercase();
if (Common::isDigit(ext[0]) && Common::isDigit(ext[1]) && Common::isDigit(ext[2])) {
int slotNum = atoi(ext.c_str());
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
if (in) {
saveList.push_back(SaveStateDescriptor(slotNum+1, savenames[slotNum]));
delete in;
}
int slotNum = atoi(ext.c_str());
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
if (in) {
saveList.push_back(SaveStateDescriptor(slotNum+1, savenames[slotNum]));
delete in;
}
}

Expand Down

0 comments on commit 0a670db

Please sign in to comment.