[XAM] Maintain usage of constant XUserIndexAny

This commit is contained in:
Adrian 2024-11-27 17:48:57 +00:00 committed by Radosław Gliński
parent 2b49fc2ddc
commit 3ab712824e
3 changed files with 4 additions and 4 deletions

View File

@ -393,7 +393,7 @@ uint8_t ProfileManager::FindFirstFreeProfileSlot() const {
return i; return i;
} }
} }
return -1; return XUserIndexAny;
} }
std::bitset<XUserMaxUserCount> ProfileManager::GetUsedUserSlots() const { std::bitset<XUserMaxUserCount> ProfileManager::GetUsedUserSlots() const {
@ -422,7 +422,7 @@ uint8_t ProfileManager::GetUserIndexAssignedToProfile(
return index; return index;
} }
return -1; return XUserIndexAny;
} }
std::filesystem::path ProfileManager::GetProfileContentPath( std::filesystem::path ProfileManager::GetProfileContentPath(

View File

@ -89,7 +89,7 @@ class ProfileManager {
bool MountProfile(const uint64_t xuid); bool MountProfile(const uint64_t xuid);
bool DismountProfile(const uint64_t xuid); bool DismountProfile(const uint64_t xuid);
void Login(const uint64_t xuid, const uint8_t user_index = -1, void Login(const uint64_t xuid, const uint8_t user_index = XUserIndexAny,
bool notify = true); bool notify = true);
void Logout(const uint8_t user_index, bool notify = true); void Logout(const uint8_t user_index, bool notify = true);
void LoginMultiple(const std::map<uint8_t, uint64_t>& profiles); void LoginMultiple(const std::map<uint8_t, uint64_t>& profiles);

View File

@ -1251,7 +1251,7 @@ class SigninDialog : public XamDialog {
uint64_t xuid = elem.first; uint64_t xuid = elem.first;
uint8_t slot = profile_manager->GetUserIndexAssignedToProfile(xuid); uint8_t slot = profile_manager->GetUserIndexAssignedToProfile(xuid);
for (uint32_t j = 0; j < users_needed_; j++) { for (uint32_t j = 0; j < users_needed_; j++) {
if (chosen_slots_[j] != 0xFF && slot == chosen_slots_[j]) { if (chosen_slots_[j] != XUserIndexAny && slot == chosen_slots_[j]) {
chosen_xuids_[j] = xuid; chosen_xuids_[j] = xuid;
} }
} }