aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-02 15:43:51 -0800
committerGitHub <noreply@github.com>2021-02-02 15:43:51 -0800
commit6f37a7805689a3cd934f86b33ff0f8a63e032ed6 (patch)
treece59653eacc62b466023dcfead117cd64c6fbcf5 /src
parentcac3881076998d590733d76c1641ee64721e45f0 (diff)
parentf970b836e503a206ea6e0bbda4f7db18942ffcd1 (diff)
Merge pull request #5842 from german77/userfix
acc: Fix error when second user is selected
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index d9865d56fa..50b2c58e2b 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -41,12 +41,18 @@ constexpr char ACC_SAVE_AVATORS_BASE_PATH[] = "/system/save/8000000000000010/su/
ProfileManager::ProfileManager() {
ParseUserSaveFile();
- if (user_count == 0)
+ // Create an user if none are present
+ if (user_count == 0) {
CreateNewUser(UUID::Generate(), "yuzu");
+ }
auto current = std::clamp<int>(Settings::values.current_user, 0, MAX_USERS - 1);
- if (UserExistsIndex(current))
+
+ // If user index don't exist. Load the first user and change the active user
+ if (!UserExistsIndex(current)) {
current = 0;
+ Settings::values.current_user = 0;
+ }
OpenUser(*GetUser(current));
}