diff options
author | Filippos Karapetis | 2010-08-29 11:08:27 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-08-29 11:08:27 +0000 |
commit | 6a058892fbc00821c05703a1aa980ee763c3e673 (patch) | |
tree | 31bbdc5086d84eee8fe4210f73930a79ea73f04d /engines/sci | |
parent | 9e9db758fb6600cf6dfb8a1ba10996de6e3425c9 (diff) | |
download | scummvm-rg350-6a058892fbc00821c05703a1aa980ee763c3e673.tar.gz scummvm-rg350-6a058892fbc00821c05703a1aa980ee763c3e673.tar.bz2 scummvm-rg350-6a058892fbc00821c05703a1aa980ee763c3e673.zip |
SCI: Throw a warning in QFG import screens for unmatched files
The original SCI games supported up to 12 characters for file names, thus we
use the file name returned as a mask to find the actual file, as we don't
wrap/unwrap save file names in these screens. If no files match, or if more
than 1 files match, throw a warning.
svn-id: r52437
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 99567d5d6e..fa5bee0003 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -823,7 +823,16 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) { Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); Common::StringArray saveNames = saveFileMan->listSavefiles(pattern); - name = saveNames.size() > 0 ? saveNames[0] : name; + + // There should be exactly one match for this search, otherwise throw a warning + if (saveNames.size() == 0) { + warning("QFG No matches for %s", pattern.c_str()); + } else if (saveNames.size() == 1) { + name = saveNames[0]; + } else { + warning("More than 1 matches for %s, using the first one", pattern.c_str()); + name = saveNames[0]; + } } return file_open(s, name.c_str(), mode); |