From 02522a3a144cad030262533506baafa0460056a6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 8 Feb 2008 18:43:13 +0000 Subject: Should fix regression which prevented kyra.dat to be detected corretly when in game path. svn-id: r30830 --- engines/kyra/resource.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'engines') diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index bc0ebe4fba..cbb39596c9 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -228,18 +228,6 @@ void Resource::unloadAllPakFiles() { _map.clear(); Common::File temp; - if (temp.open("kyra.dat")) { - ResFileEntry entry; - entry.parent = ""; - entry.size = temp.size(); - entry.loadable = true; - entry.preload = false; - entry.prot = false; - entry.type = ResFileEntry::kPak; - entry.offset = 0; - _map["kyra.dat"] = entry; - temp.close(); - } for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { ResFileEntry entry; @@ -256,6 +244,24 @@ void Resource::unloadAllPakFiles() { temp.close(); } + ResFileMap::iterator iter = _map.find("kyra.dat"); + if (iter == _map.end()) { + if (temp.open("kyra.dat")) { + ResFileEntry entry; + entry.parent = ""; + entry.size = temp.size(); + entry.loadable = true; + entry.preload = false; + entry.prot = false; + entry.type = ResFileEntry::kPak; + entry.offset = 0; + _map["kyra.dat"] = entry; + temp.close(); + } + } else { + iter->_value.type = ResFileEntry::kPak; + } + detectFileTypes(); } -- cgit v1.2.3