ENGINES: Fix listSaves for 3-digit savegame patterns
This commit is contained in:
parent
c515216cd3
commit
e96a72ae87
1 changed files with 6 additions and 2 deletions
|
@ -333,8 +333,12 @@ SaveStateList MetaEngine::listSaves(const char *target) const {
|
|||
|
||||
SaveStateList saveList;
|
||||
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||
int slotNum = atoi(file->c_str() + file->size() - 2);
|
||||
// Obtain the last 2/3 digits of the filename, since they correspond to the save slot
|
||||
const char *slotStr = file->c_str() + file->size() - 2;
|
||||
const char *prev = slotStr - 1;
|
||||
if (*prev >= '0' && *prev <= '9')
|
||||
slotStr = prev;
|
||||
int slotNum = atoi(slotStr);
|
||||
|
||||
if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
|
||||
SaveStateDescriptor desc = querySaveMetaInfos(target, slotNum);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue