aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/resource.cpp30
1 files changed, 18 insertions, 12 deletions
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();
}