diff options
| -rw-r--r-- | src/core/file_sys/ips_layer.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/patch_manager.cpp | 14 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index a33dbe94b..c1a484497 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp | |||
| @@ -217,9 +217,7 @@ void IPSwitchCompiler::Parse() { | |||
| 217 | break; | 217 | break; |
| 218 | } else if (StartsWith(line, "@nsobid-")) { | 218 | } else if (StartsWith(line, "@nsobid-")) { |
| 219 | // NSO Build ID Specifier | 219 | // NSO Build ID Specifier |
| 220 | auto raw_build_id = line.substr(8); | 220 | const auto raw_build_id = fmt::format("{:0>64}", line.substr(8)); |
| 221 | if (raw_build_id.size() != 0x40) | ||
| 222 | raw_build_id.resize(0x40, '0'); | ||
| 223 | nso_build_id = Common::HexStringToArray<0x20>(raw_build_id); | 221 | nso_build_id = Common::HexStringToArray<0x20>(raw_build_id); |
| 224 | } else if (StartsWith(line, "#")) { | 222 | } else if (StartsWith(line, "#")) { |
| 225 | // Mandatory Comment | 223 | // Mandatory Comment |
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index bd525b26c..41348ab26 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp | |||
| @@ -191,6 +191,7 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { | |||
| 191 | std::vector<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualDir>& patch_dirs, | 191 | std::vector<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualDir>& patch_dirs, |
| 192 | const std::string& build_id) const { | 192 | const std::string& build_id) const { |
| 193 | const auto& disabled = Settings::values.disabled_addons[title_id]; | 193 | const auto& disabled = Settings::values.disabled_addons[title_id]; |
| 194 | const auto nso_build_id = fmt::format("{:0>64}", build_id); | ||
| 194 | 195 | ||
| 195 | std::vector<VirtualFile> out; | 196 | std::vector<VirtualFile> out; |
| 196 | out.reserve(patch_dirs.size()); | 197 | out.reserve(patch_dirs.size()); |
| @@ -203,21 +204,18 @@ std::vector<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualD | |||
| 203 | for (const auto& file : exefs_dir->GetFiles()) { | 204 | for (const auto& file : exefs_dir->GetFiles()) { |
| 204 | if (file->GetExtension() == "ips") { | 205 | if (file->GetExtension() == "ips") { |
| 205 | auto name = file->GetName(); | 206 | auto name = file->GetName(); |
| 206 | const auto p1 = name.substr(0, name.find('.')); | ||
| 207 | const auto this_build_id = p1.substr(0, p1.find_last_not_of('0') + 1); | ||
| 208 | 207 | ||
| 209 | if (build_id == this_build_id) | 208 | const auto this_build_id = |
| 209 | fmt::format("{:0>64}", name.substr(0, name.find('.'))); | ||
| 210 | if (nso_build_id == this_build_id) | ||
| 210 | out.push_back(file); | 211 | out.push_back(file); |
| 211 | } else if (file->GetExtension() == "pchtxt") { | 212 | } else if (file->GetExtension() == "pchtxt") { |
| 212 | IPSwitchCompiler compiler{file}; | 213 | IPSwitchCompiler compiler{file}; |
| 213 | if (!compiler.IsValid()) | 214 | if (!compiler.IsValid()) |
| 214 | continue; | 215 | continue; |
| 215 | 216 | ||
| 216 | auto this_build_id = Common::HexToString(compiler.GetBuildID()); | 217 | const auto this_build_id = Common::HexToString(compiler.GetBuildID()); |
| 217 | this_build_id = | 218 | if (nso_build_id == this_build_id) |
| 218 | this_build_id.substr(0, this_build_id.find_last_not_of('0') + 1); | ||
| 219 | |||
| 220 | if (build_id == this_build_id) | ||
| 221 | out.push_back(file); | 219 | out.push_back(file); |
| 222 | } | 220 | } |
| 223 | } | 221 | } |