summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-12-08 04:02:56 +0100
committerLioncash <mathew1800@gmail.com>2020-12-08 04:02:58 +0100
commit97dd67ad1cf417e85546a90afece8b2958954ca8 (patch)
treec9d0910a956fccb083227c983b6e777507b91904 /src/core/hle/service
parentMerge pull request #5164 from lioncash/contains (diff)
downloadyuzu-97dd67ad1cf417e85546a90afece8b2958954ca8.tar
yuzu-97dd67ad1cf417e85546a90afece8b2958954ca8.tar.gz
yuzu-97dd67ad1cf417e85546a90afece8b2958954ca8.tar.bz2
yuzu-97dd67ad1cf417e85546a90afece8b2958954ca8.tar.lz
yuzu-97dd67ad1cf417e85546a90afece8b2958954ca8.tar.xz
yuzu-97dd67ad1cf417e85546a90afece8b2958954ca8.tar.zst
yuzu-97dd67ad1cf417e85546a90afece8b2958954ca8.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/am/applets/controller.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/core/hle/service/am/applets/controller.cpp b/src/core/hle/service/am/applets/controller.cpp
index e8ea4248b..2504cac32 100644
--- a/src/core/hle/service/am/applets/controller.cpp
+++ b/src/core/hle/service/am/applets/controller.cpp
@@ -227,15 +227,14 @@ void Controller::ConfigurationComplete() {
// If enable_single_mode is enabled, player_count is 1 regardless of any other parameters.
// Otherwise, only count connected players from P1-P8.
result_info.player_count =
- is_single_mode ? 1
- : static_cast<s8>(std::count_if(
- players.begin(), players.end() - 2,
- [](Settings::PlayerInput player) { return player.connected; }));
-
- result_info.selected_id = HID::Controller_NPad::IndexToNPad(
- std::distance(players.begin(),
- std::find_if(players.begin(), players.end(),
- [](Settings::PlayerInput player) { return player.connected; })));
+ is_single_mode
+ ? 1
+ : static_cast<s8>(std::count_if(players.begin(), players.end() - 2,
+ [](const auto& player) { return player.connected; }));
+
+ result_info.selected_id = HID::Controller_NPad::IndexToNPad(std::distance(
+ players.begin(), std::find_if(players.begin(), players.end(),
+ [](const auto& player) { return player.connected; })));
result_info.result = 0;