summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-03 00:43:51 +0100
committerGitHub <noreply@github.com>2021-02-03 00:43:51 +0100
commit48d040fded1f189162bdfd338b71a5cf7b0423f8 (patch)
treece59653eacc62b466023dcfead117cd64c6fbcf5 /src/core/hle
parentMerge pull request #5841 from german77/username (diff)
parentFix user changing to 0 if valid (diff)
downloadyuzu-48d040fded1f189162bdfd338b71a5cf7b0423f8.tar
yuzu-48d040fded1f189162bdfd338b71a5cf7b0423f8.tar.gz
yuzu-48d040fded1f189162bdfd338b71a5cf7b0423f8.tar.bz2
yuzu-48d040fded1f189162bdfd338b71a5cf7b0423f8.tar.lz
yuzu-48d040fded1f189162bdfd338b71a5cf7b0423f8.tar.xz
yuzu-48d040fded1f189162bdfd338b71a5cf7b0423f8.tar.zst
yuzu-48d040fded1f189162bdfd338b71a5cf7b0423f8.zip
Diffstat (limited to 'src/core/hle')
-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 d9865d56f..50b2c58e2 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));
}