|
@@ -133,6 +133,12 @@ namespace LOTRO_DAT {
|
|
void SubDirectory::UpdateDirectories(std::unordered_set<long long> &patched_files, std::unordered_map<long long, Subfile*> &dict) {
|
|
void SubDirectory::UpdateDirectories(std::unordered_set<long long> &patched_files, std::unordered_map<long long, Subfile*> &dict) {
|
|
for (auto subfile : subfiles_) {
|
|
for (auto subfile : subfiles_) {
|
|
long long file_id = subfile->file_id();
|
|
long long file_id = subfile->file_id();
|
|
|
|
+ if (!dat_->CorrectSubfile(subfile)) {
|
|
|
|
+ LOG(ERROR) << "While updating directories encountered incorrect subfile with id = "
|
|
|
|
+ << file_id << " (offset = " << subfile->file_offset() << ").";
|
|
|
|
+ //dat_->WriteData(BinaryData::FromNumber<4>(62079999), 4, subfile->dictionary_offset() + 8);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
|
|
if (patched_files.count(file_id) != 0) {
|
|
if (patched_files.count(file_id) != 0) {
|
|
BinaryData data(32);
|
|
BinaryData data(32);
|
|
@@ -140,8 +146,13 @@ namespace LOTRO_DAT {
|
|
|
|
|
|
auto new_subfile = dict[file_id];
|
|
auto new_subfile = dict[file_id];
|
|
|
|
|
|
|
|
+ //dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->fragments_count()), 4, subfile->dictionary_offset());
|
|
|
|
+ //dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->unknown1()), 4, subfile->dictionary_offset() + 4);
|
|
|
|
+ //dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->file_id()), 4, subfile->dictionary_offset() + 8);
|
|
dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->file_offset()), 4, subfile->dictionary_offset() + 12);
|
|
dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->file_offset()), 4, subfile->dictionary_offset() + 12);
|
|
dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->file_size()), 4, subfile->dictionary_offset() + 16);
|
|
dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->file_size()), 4, subfile->dictionary_offset() + 16);
|
|
|
|
+ //dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->timestamp()), 4, subfile->dictionary_offset() + 20);
|
|
|
|
+ //dat_->WriteData(BinaryData::FromNumber<4>(new_subfile->version()), 4, subfile->dictionary_offset() + 24);
|
|
dat_->WriteData(BinaryData::FromNumber<4>(new_subfile ->block_size()), 4, subfile->dictionary_offset() + 28);
|
|
dat_->WriteData(BinaryData::FromNumber<4>(new_subfile ->block_size()), 4, subfile->dictionary_offset() + 28);
|
|
}
|
|
}
|
|
}
|
|
}
|