diff options
| author | 2018-11-28 14:01:29 -0500 | |
|---|---|---|
| committer | 2018-12-03 17:21:25 -0500 | |
| commit | 51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c (patch) | |
| tree | 5bfc7ea2a8488052d0a899f984815dcada891e54 /src | |
| parent | patch_manager: Obey disabled add-ons list when patching game (diff) | |
| download | yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar.gz yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar.xz yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.zip | |
aoc_u: Obey disabled add-ons list when listing DLC
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/aoc/aoc_u.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 0417fdb92..b506bc3dd 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include "core/hle/service/aoc/aoc_u.h" | 20 | #include "core/hle/service/aoc/aoc_u.h" |
| 21 | #include "core/hle/service/filesystem/filesystem.h" | 21 | #include "core/hle/service/filesystem/filesystem.h" |
| 22 | #include "core/loader/loader.h" | 22 | #include "core/loader/loader.h" |
| 23 | #include "core/settings.h" | ||
| 23 | 24 | ||
| 24 | namespace Service::AOC { | 25 | namespace Service::AOC { |
| 25 | 26 | ||
| @@ -76,6 +77,13 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) { | |||
| 76 | rb.Push(RESULT_SUCCESS); | 77 | rb.Push(RESULT_SUCCESS); |
| 77 | 78 | ||
| 78 | const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); | 79 | const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); |
| 80 | |||
| 81 | const auto& disabled = Settings::values.disabled_addons[current]; | ||
| 82 | if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) { | ||
| 83 | rb.Push<u32>(0); | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 79 | rb.Push<u32>(static_cast<u32>( | 87 | rb.Push<u32>(static_cast<u32>( |
| 80 | std::count_if(add_on_content.begin(), add_on_content.end(), | 88 | std::count_if(add_on_content.begin(), add_on_content.end(), |
| 81 | [current](u64 tid) { return CheckAOCTitleIDMatchesBase(tid, current); }))); | 89 | [current](u64 tid) { return CheckAOCTitleIDMatchesBase(tid, current); }))); |
| @@ -96,6 +104,10 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) { | |||
| 96 | out.push_back(static_cast<u32>(add_on_content[i] & 0x7FF)); | 104 | out.push_back(static_cast<u32>(add_on_content[i] & 0x7FF)); |
| 97 | } | 105 | } |
| 98 | 106 | ||
| 107 | const auto& disabled = Settings::values.disabled_addons[current]; | ||
| 108 | if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) | ||
| 109 | out = {}; | ||
| 110 | |||
| 99 | if (out.size() < offset) { | 111 | if (out.size() < offset) { |
| 100 | IPC::ResponseBuilder rb{ctx, 2}; | 112 | IPC::ResponseBuilder rb{ctx, 2}; |
| 101 | // TODO(DarkLordZach): Find the correct error code. | 113 | // TODO(DarkLordZach): Find the correct error code. |