|
@@ -133,6 +133,12 @@ namespace LOTRO_DAT {
|
|
|
void SubDirectory::UpdateDirectories(std::unordered_set<long long> &patched_files, std::unordered_map<long long, Subfile*> &dict) {
|
|
|
for (auto subfile : subfiles_) {
|
|
|
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() << ").";
|
|
|
+
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
if (patched_files.count(file_id) != 0) {
|
|
|
BinaryData data(32);
|
|
@@ -140,8 +146,13 @@ namespace LOTRO_DAT {
|
|
|
|
|
|
auto new_subfile = dict[file_id];
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
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 ->block_size()), 4, subfile->dictionary_offset() + 28);
|
|
|
}
|
|
|
}
|