diff --git a/src/xenia/patcher/patch_db.cc b/src/xenia/patcher/patch_db.cc index 9a830e226..20f1e5831 100644 --- a/src/xenia/patcher/patch_db.cc +++ b/src/xenia/patcher/patch_db.cc @@ -36,8 +36,7 @@ void PatchDB::LoadPatches() { const std::filesystem::path patches_directory = patches_root_ / "patches"; const std::vector& patch_files = filesystem::ListFiles(patches_directory); - const std::regex file_name_regex_match = - std::regex("^[A-Fa-f0-9]{8}.*\\.patch\\.toml$"); + const std::regex file_name_regex_match = std::regex(patch_filename_regex); for (const xe::filesystem::FileInfo& patch_file : patch_files) { // Skip files that doesn't have only title_id as name and .patch as @@ -150,7 +149,6 @@ bool PatchDB::ReadPatchData( bool success = string_util::hex_string_to_array(data, value); if (!success) { - XELOGE("PatchDB: Cannot load patch due to invalid data!"); return false; } diff --git a/src/xenia/patcher/patch_db.h b/src/xenia/patcher/patch_db.h index f4991cfb1..e2baf4675 100644 --- a/src/xenia/patcher/patch_db.h +++ b/src/xenia/patcher/patch_db.h @@ -110,8 +110,11 @@ class PatchDB { std::vector& GetAllPatches() { return loaded_patches; } private: - std::vector loaded_patches; - std::filesystem::path patches_root_; + void ReadHash(PatchFileEntry& patchEntry, + std::shared_ptr patch_toml_fields); + + inline static const std::string patch_filename_regex = + "^[A-Fa-f0-9]{8}.*\\.patch\\.toml$"; const std::map patch_data_types_size = { {"string", PatchData(0, PatchDataType::string)}, @@ -124,8 +127,8 @@ class PatchDB { {"be16", PatchData(sizeof(uint16_t), PatchDataType::be16)}, {"be8", PatchData(sizeof(uint8_t), PatchDataType::be8)}}; - void ReadHash(PatchFileEntry& patchEntry, - std::shared_ptr patch_toml_fields); + std::vector loaded_patches; + std::filesystem::path patches_root_; }; } // namespace patcher } // namespace xe