diff options
author | sluicebox | 2019-08-30 18:00:25 -0700 |
---|---|---|
committer | sluicebox | 2019-08-30 18:00:25 -0700 |
commit | e36a4be7ce1efd6c7fff6e3c1f3f583d2bc5c189 (patch) | |
tree | 92d0eb720274dc20743d4c23e4f293cc06d4bb7a /engines/sci/engine | |
parent | 05de8819baa4c9d1daef8bd742983d0665d03474 (diff) | |
download | scummvm-rg350-e36a4be7ce1efd6c7fff6e3c1f3f583d2bc5c189.tar.gz scummvm-rg350-e36a4be7ce1efd6c7fff6e3c1f3f583d2bc5c189.tar.bz2 scummvm-rg350-e36a4be7ce1efd6c7fff6e3c1f3f583d2bc5c189.zip |
SCI: Fix addAsVirtualFiles creating titles with no files
Fixes QFG game titles appearing on import screens when no character
files exist but save files exist that match fileMask
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/file.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp index 5821313ac7..c311810997 100644 --- a/engines/sci/engine/file.cpp +++ b/engines/sci/engine/file.cpp @@ -474,10 +474,9 @@ void DirSeeker::addAsVirtualFiles(Common::String title, Common::String fileMask) // Sort all filenames alphabetically Common::sort(foundFiles.begin(), foundFiles.end()); - _files.push_back(title); - _virtualFiles.push_back(""); Common::StringArray::iterator it; Common::StringArray::iterator it_end = foundFiles.end(); + bool titleAdded = false; for (it = foundFiles.begin(); it != it_end; it++) { Common::String regularFilename = *it; @@ -488,6 +487,13 @@ void DirSeeker::addAsVirtualFiles(Common::String title, Common::String fileMask) delete testfile; if (testfileSize > 1024) // check, if larger than 1k. in that case its a saved game. continue; // and we dont want to have those in the list + + if (!titleAdded) { + _files.push_back(title); + _virtualFiles.push_back(""); + titleAdded = true; + } + // We need to remove the prefix for display purposes _files.push_back(wrappedFilename); // but remember the actual name as well |