mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-23 18:24:59 +00:00
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
This commit is contained in:
parent
9e9db758fb
commit
6a058892fb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user