Browse Source

Merge branch 'dev' of LotRO_Legacy/LotroDat into master

Ivan Arkhipov 4 years ago
parent
commit
7d8bc8c892

+ 1 - 1
include/LotroDat.h

@@ -2,7 +2,7 @@
 // Created by Иван_Архипов on 01.11.2017.
 //
 
-#define LOTRO_DAT_VERSION "7.2.2"
+#define LOTRO_DAT_VERSION "7.3.0"
 
 #include "DatFile.h"
 #include "Database.h"

+ 1 - 1
src/DatSubsystems/DatBackupManager.cpp

@@ -72,7 +72,7 @@ namespace LOTRO_DAT {
         std::string dat_filename = dat->GetIO().GetFilename().value;
         dat->Deinitialize();
 
-        FILE* file = fopen(backup_datname.c_str(), "w+b");
+        FILE* file = fopen(dat_filename.c_str(), "w+b");
         if (!file)
             return DatOperationResult<>(ERROR, "RESTOREFROMBACKUP: cannot open file " + backup_datname);
 

+ 1 - 1
src/DatSubsystems/DatLocaleManager.cpp

@@ -3,7 +3,7 @@
 #include <DatFile.h>
 #include <SubFile.h>
 
-#define DAT_LOCALE_DICT_VERSION 102
+#define DAT_LOCALE_DICT_VERSION 103
 
 namespace LOTRO_DAT {
     DatLocaleManager::DatLocaleManager(DatFile *datFilePtr) : dat(datFilePtr), current_locale_(ORIGINAL) {

+ 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) {