COMMON: Probe files for existnce, so there is less noise

This commit is contained in:
Eugene Sandulenko 2023-01-07 14:08:24 +01:00
parent aa14d59447
commit 82e21f3c3c
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -69,11 +69,16 @@ bool generateZipSet(Common::SearchSet &searchSet, const char *defaultFile, const
if (!dat) {
Common::File *file = new Common::File;
if (ConfMan.hasKey(packsPath))
file->open(normalizePath(ConfMan.get(packsPath) + "/" + defaultFile, '/'));
if (ConfMan.hasKey(packsPath)) {
Common::String path(normalizePath(ConfMan.get(packsPath) + "/" + defaultFile, '/'));
if (File::exists(path))
file->open(path);
}
if (!file->isOpen())
file->open(defaultFile);
if (File::exists(defaultFile))
file->open(defaultFile);
if (file->isOpen())
dat = Common::makeZipArchive(defaultFile);