Browse Source

Added correct DatID check

Ivan Arkhipov 5 years ago
parent
commit
a79d7f5d41
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/DatSubsystems/DatPatcher.cpp

+ 11 - 0
src/DatSubsystems/DatPatcher.cpp

@@ -20,6 +20,17 @@ namespace LOTRO_DAT {
      */
 
     DatOperationResult<> DatPatcher::PatchFile(const SubfileData &data, bool single_file) {
+        if (!data.options["did"]) {
+            // Subfile data does not contain any Dat ID number, so skipping it
+            return DatOperationResult<>();
+        }
+
+        auto dat_id = data.options["did"].as<long long>();
+        if (dat_id != dat->GetDatID()) {
+            // Subfile Dat ID does not match host DAT ID, so we shouldn't patch it
+            return DatOperationResult<>();
+        }
+
         auto file_id = data.options["fid"].as<long long>();
 
         if (single_file) {