diff options
author | Johannes Schickel | 2008-02-07 23:27:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-02-07 23:27:08 +0000 |
commit | 31938bc071d6df12d31f4ad61cf368048cefea06 (patch) | |
tree | f119e32f17c6bf1d1c13459fe646e4cf3c9e1aba /engines/kyra/resource.cpp | |
parent | 9b5839082da2ad541200474c1acb5e16a3df076b (diff) | |
download | scummvm-rg350-31938bc071d6df12d31f4ad61cf368048cefea06.tar.gz scummvm-rg350-31938bc071d6df12d31f4ad61cf368048cefea06.tar.bz2 scummvm-rg350-31938bc071d6df12d31f4ad61cf368048cefea06.zip |
Fixed kyra3 code.
svn-id: r30822
Diffstat (limited to 'engines/kyra/resource.cpp')
-rw-r--r-- | engines/kyra/resource.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 52ab363608..02cc114105 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -460,10 +460,8 @@ bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableRead Common::List<ResFileEntry>::iterator entry = entries.begin(); Common::List<Common::String>::iterator file = filenames.begin(); - for (; entry != entries.end(); ++entry, ++file) { - map.erase(*file); + for (; entry != entries.end(); ++entry, ++file) map[*file] = *entry; - } return true; } @@ -496,10 +494,10 @@ bool ResLoaderIns::isLoadable(const Common::String &filename, Common::SeekableRe stream.seek(3); uint32 size = stream.readUint32LE(); - if (size > stream.size()) + if (size+7 > stream.size()) return false; - stream.seek(size+1, SEEK_SET); + stream.seek(size+5, SEEK_SET); uint8 buffer[2]; stream.read(&buffer, 2); @@ -536,8 +534,6 @@ bool ResLoaderIns::loadFile(const Common::String &filename, Common::SeekableRead stream.seek(3, SEEK_SET); for (Common::List<Common::String>::iterator file = filenames.begin(); file != filenames.end(); ++file) { - map.erase(*file); - ResFileEntry entry; entry.parent = filename; entry.type = ResFileEntry::kAutoDetect; |