DRASCULA: listSaves handles unsynced save index

This is a situation that would occur when a user copies drscula save
files from one device to another, without copying the corresponding
index, or copies the index without all corresponding save files.
This commit is contained in:
upthorn 2012-04-15 17:29:41 -07:00
parent 9e5015e631
commit 9c70954f64

View File

@ -306,7 +306,6 @@ public:
SaveStateList saveList;
int line = 1;
for (size_t i = 0; i < slots.size(); i++) {
// ignore lines corresponding to unused saveslots
for (; line < slots[i]; line++)
epa->readLine();
@ -314,6 +313,10 @@ public:
// copy the name in the line corresponding to the save slot and truncate to 22 characters
saveDesc = Common::String(epa->readLine().c_str(), 22);
// handle cases where the save directory and save index are detectably out of sync
if (saveDesc == "*")
saveDesc = "No name specified.";
// increment line number to keep it in sync with slot number
line++;