mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
Merge pull request #5842 from german77/userfix
acc: Fix error when second user is selected
This commit is contained in:
commit
48d040fded
1 changed files with 8 additions and 2 deletions
|
@ -41,12 +41,18 @@ constexpr char ACC_SAVE_AVATORS_BASE_PATH[] = "/system/save/8000000000000010/su/
|
||||||
ProfileManager::ProfileManager() {
|
ProfileManager::ProfileManager() {
|
||||||
ParseUserSaveFile();
|
ParseUserSaveFile();
|
||||||
|
|
||||||
if (user_count == 0)
|
// Create an user if none are present
|
||||||
|
if (user_count == 0) {
|
||||||
CreateNewUser(UUID::Generate(), "yuzu");
|
CreateNewUser(UUID::Generate(), "yuzu");
|
||||||
|
}
|
||||||
|
|
||||||
auto current = std::clamp<int>(Settings::values.current_user, 0, MAX_USERS - 1);
|
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;
|
current = 0;
|
||||||
|
Settings::values.current_user = 0;
|
||||||
|
}
|
||||||
|
|
||||||
OpenUser(*GetUser(current));
|
OpenUser(*GetUser(current));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue