summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-28 20:01:29 +0100
committerZach Hilman <zachhilman@gmail.com>2018-12-03 23:21:25 +0100
commit51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c (patch)
tree5bfc7ea2a8488052d0a899f984815dcada891e54 /src/core
parentpatch_manager: Obey disabled add-ons list when patching game (diff)
downloadyuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar
yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar.gz
yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar.bz2
yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar.lz
yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar.xz
yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.tar.zst
yuzu-51483d83bbe6a7d3a29a8bf129b2f4b9a04d229c.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/aoc/aoc_u.cpp12
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 @@
#include "core/hle/service/aoc/aoc_u.h"
#include "core/hle/service/filesystem/filesystem.h"
#include "core/loader/loader.h"
+#include "core/settings.h"
namespace Service::AOC {
@@ -76,6 +77,13 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS);
const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID();
+
+ const auto& disabled = Settings::values.disabled_addons[current];
+ if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) {
+ rb.Push<u32>(0);
+ return;
+ }
+
rb.Push<u32>(static_cast<u32>(
std::count_if(add_on_content.begin(), add_on_content.end(),
[current](u64 tid) { return CheckAOCTitleIDMatchesBase(tid, current); })));
@@ -96,6 +104,10 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
out.push_back(static_cast<u32>(add_on_content[i] & 0x7FF));
}
+ const auto& disabled = Settings::values.disabled_addons[current];
+ if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end())
+ out = {};
+
if (out.size() < offset) {
IPC::ResponseBuilder rb{ctx, 2};
// TODO(DarkLordZach): Find the correct error code.