]> git.tdb.fi Git - libs/datafile.git/commitdiff
Replace files from earlier packs with those from the newly added one
authorMikko Rasa <tdb@tdb.fi>
Sat, 29 Oct 2016 16:45:40 +0000 (19:45 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 29 Oct 2016 16:45:40 +0000 (19:45 +0300)
source/packsource.cpp

index 1accdb0fc3a384c456f4535db23e164a89efb5b7..f4c06b5deab36260d50b4736009977b569db6270 100644 (file)
@@ -60,9 +60,11 @@ void PackSource::add_pack(IO::Seekable *io, const string &fn, const string &filt
 
        FileMap pack_files;
        pack->collect_files(pack_files, filter);
 
        FileMap pack_files;
        pack->collect_files(pack_files, filter);
-       files.insert(pack_files.begin(), pack_files.end());
        for(FileMap::const_iterator i=pack_files.begin(); i!=pack_files.end(); ++i)
        for(FileMap::const_iterator i=pack_files.begin(); i!=pack_files.end(); ++i)
+       {
+               files[i->first] = i->second;
                i->second->collect_objects(objects);
                i->second->collect_objects(objects);
+       }
 }
 
 list<PackSource::FileInfo> PackSource::list_files() const
 }
 
 list<PackSource::FileInfo> PackSource::list_files() const