Index: engines/kyra/resource.cpp
===================================================================
--- engines/kyra/resource.cpp	(revision 33849)
+++ engines/kyra/resource.cpp	(working copy)
@@ -353,7 +353,17 @@
 Common::SeekableReadStream *Resource::getFileStream(const Common::String &file) {
 	CompFileMap::iterator compEntry;
 
-	if (Common::File::exists(file)) {
+	if ((compEntry = _compFiles.find(file)) != _compFiles.end())
+		return new Common::MemoryReadStream(compEntry->_value.data, compEntry->_value.size, false);		
+
+	if (!isAccessable(file))
+		return 0;
+
+	ResFileMap::const_iterator iter = _map.find(file);
+	if (iter == _map.end())
+		return 0;
+
+	if (iter->_value.parent.empty()) {
 		Common::File *stream = new Common::File();
 		if (!stream->open(file)) {
 			delete stream;
@@ -361,28 +371,15 @@
 			error("Couldn't open file '%s'", file.c_str());
 		}
 		return stream;
-	} else if ((compEntry = _compFiles.find(file)) != _compFiles.end()) {
-		return new Common::MemoryReadStream(compEntry->_value.data, compEntry->_value.size, false);		
 	} else {
-		if (!isAccessable(file))
-			return 0;
+		Common::SeekableReadStream *parent = getFileStream(iter->_value.parent);
+		assert(parent);
 
-		ResFileMap::const_iterator iter = _map.find(file);
-		if (iter == _map.end())
-			return 0;
+		ResFileMap::const_iterator parentIter = _map.find(iter->_value.parent);
+		const ResArchiveLoader *loader = getLoader(parentIter->_value.type);
+		assert(loader);
 
-		if (!iter->_value.parent.empty()) {
-			Common::SeekableReadStream *parent = getFileStream(iter->_value.parent);
-			assert(parent);
-
-			ResFileMap::const_iterator parentIter = _map.find(iter->_value.parent);
-			const ResArchiveLoader *loader = getLoader(parentIter->_value.type);
-			assert(loader);
-
-			return loader->loadFileFromArchive(file, parent, iter->_value);
-		} else {
-			error("Couldn't open file '%s'", file.c_str());
-		}
+		return loader->loadFileFromArchive(file, parent, iter->_value);
 	}
 
 	return 0;
@@ -414,7 +411,19 @@
 	if (_map.find(file) == _map.end()) {
 		CompFileMap::const_iterator iter;
 
-		if (Common::File::exists(file)) {
+		if ((iter = _compFiles.find(file)) != _compFiles.end()) {
+			ResFileEntry entry;
+			entry.parent = "";
+			entry.size = iter->_value.size;
+			entry.mounted = false;
+			entry.preload = false;
+			entry.prot = false;
+			entry.type = ResFileEntry::kAutoDetect;
+			entry.offset = 0;
+			_map[file] = entry;
+
+			detectFileTypes();
+		} else if (Common::File::exists(file)) {
 			Common::File temp;
 			if (temp.open(file)) {
 				ResFileEntry entry;
@@ -430,18 +439,6 @@
 
 				detectFileTypes();
 			}
-		} else if ((iter = _compFiles.find(file)) != _compFiles.end()) {
-			ResFileEntry entry;
-			entry.parent = "";
-			entry.size = iter->_value.size;
-			entry.mounted = false;
-			entry.preload = false;
-			entry.prot = false;
-			entry.type = ResFileEntry::kAutoDetect;
-			entry.offset = 0;
-			_map[file] = entry;
-
-			detectFileTypes();
 		}
 	}
 }
