Use the save file manager's listSavefiles() function to find out if any savegames
exist at all. (The old method was to potentially try and open a hundred files, though it would stop after finding the first one.) svn-id: r34790
This commit is contained in:
parent
4a56e0d9c1
commit
dc75da4348
1 changed files with 4 additions and 5 deletions
|
@ -388,15 +388,14 @@ uint32 Sword2Engine::getSaveDescription(uint16 slotNo, byte *description) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Sword2Engine::saveExists() {
|
bool Sword2Engine::saveExists() {
|
||||||
for (int i = 0; i <= 99; i++)
|
Common::String pattern = _targetName + ".???";
|
||||||
if (saveExists(i))
|
Common::StringList filenames = _saveFileMan->listSavefiles(pattern.c_str());
|
||||||
return true;
|
|
||||||
return false;
|
return !filenames.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Sword2Engine::saveExists(uint16 slotNo) {
|
bool Sword2Engine::saveExists(uint16 slotNo) {
|
||||||
char *saveFileName = getSaveFileName(slotNo);
|
char *saveFileName = getSaveFileName(slotNo);
|
||||||
|
|
||||||
Common::InSaveFile *in;
|
Common::InSaveFile *in;
|
||||||
|
|
||||||
if (!(in = _saveFileMan->openForLoading(saveFileName))) {
|
if (!(in = _saveFileMan->openForLoading(saveFileName))) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue