diff options
-rw-r--r-- | common/archive.cpp | 9 | ||||
-rw-r--r-- | common/file.cpp | 7 |
2 files changed, 3 insertions, 13 deletions
diff --git a/common/archive.cpp b/common/archive.cpp index 1fce9c144a..8add12e570 100644 --- a/common/archive.cpp +++ b/common/archive.cpp @@ -141,15 +141,6 @@ SeekableReadStream *FSDirectory::createReadStreamForMember(const String &name) c return 0; FSNode node = lookupCache(_fileCache, name); - - if (!node.exists()) { - warning("FSDirectory::createReadStreamForMember: FSNode does not exist"); - return 0; - } else if (node.isDirectory()) { - warning("FSDirectory::createReadStreamForMember: FSNode is a directory"); - return 0; - } - SeekableReadStream *stream = node.createReadStream(); if (!stream) warning("FSDirectory::createReadStreamForMember: Can't create stream for file '%s'", name.c_str()); diff --git a/common/file.cpp b/common/file.cpp index 69f4a4a31b..ee741a8990 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -61,14 +61,13 @@ bool File::open(const String &filename, Archive &archive) { clearIOFailed(); SeekableReadStream *stream = 0; - if (archive.hasFile(filename)) { + + if ((stream = archive.createReadStreamForMember(filename))) { debug(3, "Opening hashed: %s", filename.c_str()); - stream = archive.createReadStreamForMember(filename); - } else if (archive.hasFile(filename + ".")) { + } else if ((stream = archive.createReadStreamForMember(filename + "."))) { // WORKAROUND: Bug #1458388: "SIMON1: Game Detection fails" // sometimes instead of "GAMEPC" we get "GAMEPC." (note trailing dot) debug(3, "Opening hashed: %s.", filename.c_str()); - stream = archive.createReadStreamForMember(filename + "."); } return open(stream, filename); |