summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/patch_manager.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-08-19 23:16:33 +0200
committerLiam <byteslice@airmail.cc>2022-08-19 23:16:33 +0200
commit39cf6abd942f4f57890317ad8f49a7649ba55288 (patch)
tree0caaaa9f989284e7134774a8de9aeac56ceb7e5e /src/core/file_sys/patch_manager.cpp
parentMerge pull request #8772 from liushuyu/remove-common-intrin (diff)
downloadyuzu-39cf6abd942f4f57890317ad8f49a7649ba55288.tar
yuzu-39cf6abd942f4f57890317ad8f49a7649ba55288.tar.gz
yuzu-39cf6abd942f4f57890317ad8f49a7649ba55288.tar.bz2
yuzu-39cf6abd942f4f57890317ad8f49a7649ba55288.tar.lz
yuzu-39cf6abd942f4f57890317ad8f49a7649ba55288.tar.xz
yuzu-39cf6abd942f4f57890317ad8f49a7649ba55288.tar.zst
yuzu-39cf6abd942f4f57890317ad8f49a7649ba55288.zip
Diffstat (limited to 'src/core/file_sys/patch_manager.cpp')
-rw-r--r--src/core/file_sys/patch_manager.cpp14
1 files changed, 6 insertions, 8 deletions
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 {
std::vector<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualDir>& patch_dirs,
const std::string& build_id) const {
const auto& disabled = Settings::values.disabled_addons[title_id];
+ const auto nso_build_id = fmt::format("{:0>64}", build_id);
std::vector<VirtualFile> out;
out.reserve(patch_dirs.size());
@@ -203,21 +204,18 @@ std::vector<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualD
for (const auto& file : exefs_dir->GetFiles()) {
if (file->GetExtension() == "ips") {
auto name = file->GetName();
- const auto p1 = name.substr(0, name.find('.'));
- const auto this_build_id = p1.substr(0, p1.find_last_not_of('0') + 1);
- if (build_id == this_build_id)
+ const auto this_build_id =
+ fmt::format("{:0>64}", name.substr(0, name.find('.')));
+ if (nso_build_id == this_build_id)
out.push_back(file);
} else if (file->GetExtension() == "pchtxt") {
IPSwitchCompiler compiler{file};
if (!compiler.IsValid())
continue;
- auto this_build_id = Common::HexToString(compiler.GetBuildID());
- this_build_id =
- this_build_id.substr(0, this_build_id.find_last_not_of('0') + 1);
-
- if (build_id == this_build_id)
+ const auto this_build_id = Common::HexToString(compiler.GetBuildID());
+ if (nso_build_id == this_build_id)
out.push_back(file);
}
}